Class MemEventRepository<T extends RootEntity>
java.lang.Object
com.cloudimpl.outstack.runtime.EventRepositoy<T>
com.cloudimpl.outstack.runtime.repo.MemEventRepository<T>
- Type Parameters:
T-
- All Implemented Interfaces:
QueryOperations<T>
public class MemEventRepository<T extends RootEntity> extends EventRepositoy<T>
- Author:
- nuwan
-
Field Summary
Fields inherited from class com.cloudimpl.outstack.runtime.EventRepositoy
resourceHelper, rootType, TID_PREFIX, version -
Constructor Summary
Constructors Constructor Description MemEventRepository(java.lang.Class<T> rootType, ResourceHelper resourceHelper) -
Method Summary
Modifier and Type Method Description protected java.util.Optional<EntityCheckpoint>_getCheckpoint(java.lang.String rootTrn)protected voidaddEvent(Event event)protected <C extends ChildEntity<T>>
voiddeleteChildEntityBrnById(ChildEntity e, boolean deleteOnlyEntity)protected <C extends ChildEntity<T>>
voiddeleteChildEntityTrnById(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId)protected voiddeleteRootEntityBrnById(RootEntity e, boolean deleteOnlyEntity)protected voiddeleteRootEntityTrnById(java.lang.Class<T> rootType, java.lang.String id, java.lang.String tenantId)protected voidendTransaction()ResultSet<T>getAllByRootType(java.lang.Class<T> rootType, java.lang.String tenantId, Query.PagingRequest paging)ResultSet<T>getAllByRootType(java.lang.Class<T> rootType, java.util.Collection<java.lang.String> tenantId, Query.PagingRequest paging)<K extends ChildEntity<T>>
ResultSet<K>getAllChildByType(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<K> childType, java.lang.String tenantId, Query.PagingRequest paging)<T1 extends ChildEntity<T>>
ResultSet<T1>getAllChildByType(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<T1> childType, java.util.Collection<java.lang.String> tenantId, Query.PagingRequest paging)protected <C extends ChildEntity<T>>
java.util.Collection<C>getAllChildByType(java.lang.String rootBrn, java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType)<C extends ChildEntity<T>>
java.util.Optional<C>getChildById(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId)<K extends ChildEntity<T>>
ResultSet<Event<K>>getEventsByChildId(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<K> childType, java.lang.String childId, java.lang.String tenantId, Query.PagingRequest paging)ResultSet<Event<T>>getEventsByRootId(java.lang.Class<T> rootType, java.lang.String rootId, java.lang.String tenantId, Query.PagingRequest paging)java.util.Optional<T>getRootById(java.lang.Class<T> rootType, java.lang.String id, java.lang.String tenantId)booleanisIdExist(java.lang.String id, java.lang.String tenantId)protected voidsaveChildEntityBrnIfExist(long lastSeq, ChildEntity e)protected voidsaveChildEntityBrnIfNotExist(ChildEntity e)protected voidsaveChildEntityTrnIfExist(long lastSeq, ChildEntity e)protected voidsaveChildEntityTrnIfNotExist(ChildEntity e)protected voidsaveEntity(Entity e)protected voidsaveRootEntityBrnIfExist(long lastSeq, RootEntity e)protected voidsaveRootEntityBrnIfNotExist(RootEntity e)protected voidsaveRootEntityTrnIfExist(long lastSeq, RootEntity e)protected voidsaveRootEntityTrnIfNotExist(RootEntity e)protected voidstartTransaction()protected voidupdateCheckpoint(EntityCheckpoint checkpoint)Methods inherited from class com.cloudimpl.outstack.runtime.EventRepositoy
applyEvent, generateTid, getCheckpoint, loadEntityWithClone, resourcePrefix, saveTxMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MemEventRepository
-
-
Method Details
-
startTransaction
protected void startTransaction()- Specified by:
startTransactionin classEventRepositoy<T extends RootEntity>
-
endTransaction
protected void endTransaction()- Specified by:
endTransactionin classEventRepositoy<T extends RootEntity>
-
saveEntity
-
getAllChildByType
protected <C extends ChildEntity<T>> java.util.Collection<C> getAllChildByType(java.lang.String rootBrn, java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType) -
_getCheckpoint
- Specified by:
_getCheckpointin classEventRepositoy<T extends RootEntity>
-
getAllChildByType
public <K extends ChildEntity<T>> ResultSet<K> getAllChildByType(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<K> childType, java.lang.String tenantId, Query.PagingRequest paging) -
getAllChildByType
public <T1 extends ChildEntity<T>> ResultSet<T1> getAllChildByType(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<T1> childType, java.util.Collection<java.lang.String> tenantId, Query.PagingRequest paging) -
getRootById
-
getChildById
public <C extends ChildEntity<T>> java.util.Optional<C> getChildById(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId) -
getAllByRootType
public ResultSet<T> getAllByRootType(java.lang.Class<T> rootType, java.lang.String tenantId, Query.PagingRequest paging) -
getAllByRootType
public ResultSet<T> getAllByRootType(java.lang.Class<T> rootType, java.util.Collection<java.lang.String> tenantId, Query.PagingRequest paging) -
getEventsByRootId
public ResultSet<Event<T>> getEventsByRootId(java.lang.Class<T> rootType, java.lang.String rootId, java.lang.String tenantId, Query.PagingRequest paging) -
getEventsByChildId
public <K extends ChildEntity<T>> ResultSet<Event<K>> getEventsByChildId(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<K> childType, java.lang.String childId, java.lang.String tenantId, Query.PagingRequest paging) -
saveRootEntityBrnIfNotExist
- Specified by:
saveRootEntityBrnIfNotExistin classEventRepositoy<T extends RootEntity>
-
saveRootEntityTrnIfNotExist
- Specified by:
saveRootEntityTrnIfNotExistin classEventRepositoy<T extends RootEntity>
-
saveRootEntityBrnIfExist
- Specified by:
saveRootEntityBrnIfExistin classEventRepositoy<T extends RootEntity>
-
saveRootEntityTrnIfExist
- Specified by:
saveRootEntityTrnIfExistin classEventRepositoy<T extends RootEntity>
-
saveChildEntityBrnIfNotExist
- Specified by:
saveChildEntityBrnIfNotExistin classEventRepositoy<T extends RootEntity>
-
saveChildEntityTrnIfNotExist
- Specified by:
saveChildEntityTrnIfNotExistin classEventRepositoy<T extends RootEntity>
-
saveChildEntityBrnIfExist
- Specified by:
saveChildEntityBrnIfExistin classEventRepositoy<T extends RootEntity>
-
saveChildEntityTrnIfExist
- Specified by:
saveChildEntityTrnIfExistin classEventRepositoy<T extends RootEntity>
-
deleteRootEntityBrnById
- Specified by:
deleteRootEntityBrnByIdin classEventRepositoy<T extends RootEntity>
-
deleteRootEntityTrnById
protected void deleteRootEntityTrnById(java.lang.Class<T> rootType, java.lang.String id, java.lang.String tenantId)- Specified by:
deleteRootEntityTrnByIdin classEventRepositoy<T extends RootEntity>
-
deleteChildEntityBrnById
protected <C extends ChildEntity<T>> void deleteChildEntityBrnById(ChildEntity e, boolean deleteOnlyEntity)- Specified by:
deleteChildEntityBrnByIdin classEventRepositoy<T extends RootEntity>
-
deleteChildEntityTrnById
protected <C extends ChildEntity<T>> void deleteChildEntityTrnById(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId)- Specified by:
deleteChildEntityTrnByIdin classEventRepositoy<T extends RootEntity>
-
addEvent
- Specified by:
addEventin classEventRepositoy<T extends RootEntity>
-
updateCheckpoint
- Specified by:
updateCheckpointin classEventRepositoy<T extends RootEntity>
-
isIdExist
public boolean isIdExist(java.lang.String id, java.lang.String tenantId)
-