@InstallSubject(value="loadDelegate") public interface KeyValueCollectionLoader extends BaseCollectionLoader
KeyValueEntity
collections.Modifier and Type | Interface and Description |
---|---|
static class |
KeyValueCollectionLoader.PostLoadEvent
Event sent after successful loading of entities and setting to
the container.
|
static class |
KeyValueCollectionLoader.PreLoadEvent
Event sent before loading entities.
|
Modifier and Type | Method and Description |
---|---|
Subscription |
addPostLoadListener(java.util.function.Consumer<KeyValueCollectionLoader.PostLoadEvent> listener)
Adds a listener to
KeyValueCollectionLoader.PostLoadEvent . |
Subscription |
addPreLoadListener(java.util.function.Consumer<KeyValueCollectionLoader.PreLoadEvent> listener)
Adds a listener to
KeyValueCollectionLoader.PreLoadEvent . |
ValueLoadContext |
createLoadContext()
Returns
ValueLoadContext which is created by the parameters of this loader. |
KeyValueCollectionContainer |
getContainer()
Returns the container which accepts loaded entities.
|
java.util.function.Function<ValueLoadContext,java.util.List<KeyValueEntity>> |
getDelegate()
Returns a function which will be used to load data instead of standard implementation.
|
java.lang.String |
getStoreName()
Returns data store name.
|
void |
setContainer(KeyValueCollectionContainer container)
Sets the container which accepts loaded entities.
|
void |
setLoadDelegate(java.util.function.Function<ValueLoadContext,java.util.List<KeyValueEntity>> delegate)
Sets a function which will be used to load data instead of standard implementation.
|
void |
setStoreName(java.lang.String name)
Sets the data store name.
|
getFirstResult, getMaxResults, getSort, setFirstResult, setMaxResults, setSort
getCondition, getDataContext, getParameter, getParameters, getQuery, isSoftDeletion, load, removeParameter, setCondition, setDataContext, setParameter, setParameters, setQuery, setSoftDeletion
KeyValueCollectionContainer getContainer()
getContainer
in interface BaseCollectionLoader
getContainer
in interface DataLoader
void setContainer(KeyValueCollectionContainer container)
ValueLoadContext createLoadContext()
ValueLoadContext
which is created by the parameters of this loader. The ValueLoadContext
can be used with DataManager
to load data by the same conditions.java.lang.String getStoreName()
void setStoreName(java.lang.String name)
java.util.function.Function<ValueLoadContext,java.util.List<KeyValueEntity>> getDelegate()
void setLoadDelegate(java.util.function.Function<ValueLoadContext,java.util.List<KeyValueEntity>> delegate)
Subscription addPreLoadListener(java.util.function.Consumer<KeyValueCollectionLoader.PreLoadEvent> listener)
KeyValueCollectionLoader.PreLoadEvent
.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPreLoad(KeyValueCollectionLoader.PreLoadEvent event) { // handle event here }
listener
- listenerSubscription addPostLoadListener(java.util.function.Consumer<KeyValueCollectionLoader.PostLoadEvent> listener)
KeyValueCollectionLoader.PostLoadEvent
.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPostLoad(KeyValueCollectionLoader.PostLoadEvent event) { // handle event here }
listener
- listener