Package io.jmix.dynmodel.impl
Class DynamicModelDataStore
java.lang.Object
io.jmix.core.datastore.AbstractDataStore
io.jmix.dynmodel.impl.DynamicModelDataStore
- All Implemented Interfaces:
DataStore
@Component("dynmod_DynamicModelDataStore")
public class DynamicModelDataStore
extends AbstractDataStore
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.core.datastore.AbstractDataStore
AbstractDataStore.EntityLoadInfo, AbstractDataStore.TransactionContextState -
Field Summary
Fields inherited from class io.jmix.core.datastore.AbstractDataStore
entityStates, keyValueMapper, listeners, metadata, metadataTools -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectbeginLoadTransaction(boolean joinTransaction) protected ObjectbeginSaveTransaction(boolean joinTransaction) protected AttributeChangescollectChanges(Object entity, EntityChangedEvent.Type type) The dynamic entity entry does not track which attributes changed, so an update reports every stored attribute as changed and old values are not available.protected voidcommitTransaction(Object transaction) protected longcountAll(LoadContext<?> context) protected longcountAllValues(ValueLoadContext context) deleteAll(SaveContext context) getName()This data store instance name with which it is registered inStores.getTransactionContextState(boolean isJoinTransaction) Invoked afterAbstractDataStore.beginLoadTransaction(boolean).loadAll(LoadContext<?> context) loadAllValues(ValueLoadContext context) protected @Nullable ObjectloadOne(LoadContext<?> context) protected voidpublishEntityChangedEvent(Object entity, EntityChangedEvent.Type type, AttributeChanges changes) protected voidrollbackTransaction(Object transaction) Set<?> save(SaveContext context) Saves a collection of entity instances.saveAll(SaveContext context) voidSets this data store instance name with which it is registered inStores.Methods inherited from class io.jmix.core.datastore.AbstractDataStore
beforeLoadTransactionCommit, beforeSaveTransactionCommit, beforeSaveTransactionRollback, checkAndReorderLoadedEntities, copyNonPersistentAttributes, fireEvent, getCount, getCount, getFetchPlanForSave, load, loadAllAfterSave, loadList, loadListByBatches, loadValues, registerInterceptor, setEntityStates, setKeyValueMapper, setMetadata, setMetadataTools
-
Constructor Details
-
DynamicModelDataStore
public DynamicModelDataStore()
-
-
Method Details
-
save
Description copied from interface:DataStoreSaves a collection of entity instances.- Specified by:
savein interfaceDataStore- Overrides:
savein classAbstractDataStore- Returns:
- set of saved instances
-
loadOne
- Specified by:
loadOnein classAbstractDataStore
-
loadAll
- Specified by:
loadAllin classAbstractDataStore
-
countAll
- Specified by:
countAllin classAbstractDataStore
-
saveAll
- Specified by:
saveAllin classAbstractDataStore
-
deleteAll
- Specified by:
deleteAllin classAbstractDataStore
-
collectChanges
The dynamic entity entry does not track which attributes changed, so an update reports every stored attribute as changed and old values are not available. A deletion reports the last values, so that listeners can see references of the removed instance. -
publishEntityChangedEvent
protected void publishEntityChangedEvent(Object entity, EntityChangedEvent.Type type, AttributeChanges changes) -
loadAllValues
- Specified by:
loadAllValuesin classAbstractDataStore
-
countAllValues
- Specified by:
countAllValuesin classAbstractDataStore
-
beginLoadTransaction
- Specified by:
beginLoadTransactionin classAbstractDataStore
-
beginSaveTransaction
- Specified by:
beginSaveTransactionin classAbstractDataStore
-
commitTransaction
- Specified by:
commitTransactionin classAbstractDataStore
-
rollbackTransaction
- Specified by:
rollbackTransactionin classAbstractDataStore
-
getTransactionContextState
protected AbstractDataStore.TransactionContextState getTransactionContextState(boolean isJoinTransaction) Description copied from class:AbstractDataStoreInvoked afterAbstractDataStore.beginLoadTransaction(boolean).
Override this method to createAbstractDataStore.TransactionContextStateimplementation and store required data in it.- Specified by:
getTransactionContextStatein classAbstractDataStore
-
getName
Description copied from interface:DataStoreThis data store instance name with which it is registered inStores. -
setName
Description copied from interface:DataStoreSets this data store instance name with which it is registered inStores.
-