Class EntityStoreManagerImpl
- java.lang.Object
-
- io.vertigo.datastore.impl.entitystore.EntityStoreManagerImpl
-
- All Implemented Interfaces:
io.vertigo.core.node.component.Activeable,io.vertigo.core.node.component.Component,io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Manager,io.vertigo.core.node.definition.DefinitionProvider,io.vertigo.core.node.definition.SimpleDefinitionProvider,EntityStoreManager
public final class EntityStoreManagerImpl extends Object implements EntityStoreManager, io.vertigo.core.node.component.Activeable, io.vertigo.core.node.definition.SimpleDefinitionProvider
Implementation of DataStore.- Author:
- pchretien
-
-
Field Summary
-
Fields inherited from interface io.vertigo.datastore.entitystore.EntityStoreManager
MAIN_DATA_SPACE_NAME
-
-
Constructor Summary
Constructors Constructor Description EntityStoreManagerImpl(CacheManager cacheManager, VTransactionManager transactionManager, EventBusManager eventBusManager, TaskManager taskManager, List<EntityStorePlugin> entityStorePlugins)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount(DtDefinition dtDefinition)Nombre d'éléments présents dans le sysème de persistance.<E extends Entity>
Ecreate(E entity)Create an object.voiddelete(UID<? extends Entity> uri)Destruction d'un objet persistant par son UID.<E extends Entity>
DtList<E>find(DtDefinition dtDefinition, Criteria<E> criteria, DtListState dtListState)Returns a list identified by criteria<E extends Entity>
DtList<E>findAll(DtListURI uri)Récupération d'une liste identifiée par son UID.BrokerNNgetBrokerNN()Return the a dedicated object that handles NN associationsEntityStoreConfiggetDataStoreConfig()MasterDataConfiggetMasterDataConfig()List<? extends io.vertigo.core.node.definition.Definition>provideDefinitions(io.vertigo.core.node.definition.DefinitionSpace definitionSpace)<E extends Entity>
EreadOne(UID<E> uri)Récupération d'un objet persistant par son UID.<E extends Entity>
EreadOneForUpdate(UID<E> uri)Loads and marks element for update, and ensure non concurrency.<D extends DtObject>
DtList<D>sort(DtList<D> list, String fieldName, boolean desc)Sorts a list from a column.voidstart()voidstop()voidupdate(Entity entity)Update an object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
EntityStoreManagerImpl
@Inject public EntityStoreManagerImpl(CacheManager cacheManager, VTransactionManager transactionManager, EventBusManager eventBusManager, TaskManager taskManager, List<EntityStorePlugin> entityStorePlugins)
Constructor- Parameters:
entityStoreManager- storeManagertransactionManager- transactionManagereventBusManager- eventBusManagerdataStoreConfig- dataStoreConfig
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceio.vertigo.core.node.component.Activeable
-
stop
public void stop()
- Specified by:
stopin interfaceio.vertigo.core.node.component.Activeable
-
readOneForUpdate
public <E extends Entity> E readOneForUpdate(UID<E> uri)
Loads and marks element for update, and ensure non concurrency. Fire an update event for this uid on eventbus after commit.- Specified by:
readOneForUpdatein interfaceEntityStoreManager- Type Parameters:
E- the type of entity- Parameters:
uri- UID of object- Returns:
- object to update
-
create
public <E extends Entity> E create(E entity)
Create an object. No object with the same id must have been created previously.- Specified by:
createin interfaceEntityStoreManager- Parameters:
entity- the entity to create- Returns:
- the created object
-
update
public void update(Entity entity)
Update an object. This object must have an id.- Specified by:
updatein interfaceEntityStoreManager- Parameters:
entity- the entity to update
-
delete
public void delete(UID<? extends Entity> uri)
Destruction d'un objet persistant par son UID.- Specified by:
deletein interfaceEntityStoreManager- Parameters:
uri- UID de l'objet à supprimer
-
readOne
public <E extends Entity> E readOne(UID<E> uri)
Récupération d'un objet persistant par son UID. Lorsque l'objet est en lecture seule il est possible d'accéder au objets partagés. (Liste de référence par ex) L'objet doit exister.- Specified by:
readOnein interfaceEntityStoreManager- Type Parameters:
E- the type of entity- Parameters:
uri- UID de l'object- Returns:
- object récupéré NOT NULL
-
findAll
public <E extends Entity> DtList<E> findAll(DtListURI uri)
Récupération d'une liste identifiée par son UID.- Specified by:
findAllin interfaceEntityStoreManager- Type Parameters:
E- the type of entity- Parameters:
uri- UID de la collection à récupérer- Returns:
- DtList DTC
-
count
public int count(DtDefinition dtDefinition)
Nombre d'éléments présents dans le sysème de persistance.- Specified by:
countin interfaceEntityStoreManager- Parameters:
dtDefinition- Définition de DT- Returns:
- Nombre d'éléments.
-
find
public <E extends Entity> DtList<E> find(DtDefinition dtDefinition, Criteria<E> criteria, DtListState dtListState)
Returns a list identified by criteria- Specified by:
findin interfaceEntityStoreManager- Parameters:
dtDefinition- the list definitioncriteria- criteriadtListState- request state : sort, top, offset- Returns:
- list
-
provideDefinitions
public List<? extends io.vertigo.core.node.definition.Definition> provideDefinitions(io.vertigo.core.node.definition.DefinitionSpace definitionSpace)
- Specified by:
provideDefinitionsin interfaceio.vertigo.core.node.definition.SimpleDefinitionProvider
-
getBrokerNN
public BrokerNN getBrokerNN()
Return the a dedicated object that handles NN associations- Specified by:
getBrokerNNin interfaceEntityStoreManager- Returns:
- the handler for NN Associations
-
getMasterDataConfig
public MasterDataConfig getMasterDataConfig()
- Specified by:
getMasterDataConfigin interfaceEntityStoreManager
-
getDataStoreConfig
public EntityStoreConfig getDataStoreConfig()
- Specified by:
getDataStoreConfigin interfaceEntityStoreManager- Returns:
- Configuration du StoreManager
-
-