Class PostgresEventRepository<T extends RootEntity>
java.lang.Object
com.cloudimpl.outstack.runtime.EventRepositoy<T>
com.cloudimpl.outstack.spring.repo.PostgresEventRepository<T>
- Type Parameters:
T-
- All Implemented Interfaces:
QueryOperations<T>
public class PostgresEventRepository<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 PostgresEventRepository(PostgresRepositoryFactory factory, java.lang.Class<T> rootType, ResourceHelper resourceHelper, ComponentProvider.ProviderConfigs configs) -
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)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)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)<C extends ChildEntity<T>>
ResultSet<C>getAllChildByType(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String tenantId, Query.PagingRequest paging)<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)<C extends ChildEntity<T>>
ResultSet<Event<C>>getEventsByChildId(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> 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 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
-
PostgresEventRepository
public PostgresEventRepository(PostgresRepositoryFactory factory, java.lang.Class<T> rootType, ResourceHelper resourceHelper, ComponentProvider.ProviderConfigs configs)
-
-
Method Details
-
startTransaction
protected void startTransaction()- Specified by:
startTransactionin classEventRepositoy<T extends RootEntity>
-
endTransaction
protected void endTransaction()- Specified by:
endTransactionin classEventRepositoy<T extends RootEntity>
-
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
- 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>
-
_getCheckpoint
- Specified by:
_getCheckpointin classEventRepositoy<T extends RootEntity>
-
addEvent
- Specified by:
addEventin classEventRepositoy<T extends RootEntity>
-
getAllByRootType
public ResultSet<T> getAllByRootType(java.lang.Class<T> rootType, 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) -
getAllChildByType
public <C extends ChildEntity<T>> ResultSet<C> getAllChildByType(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, 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 <C extends ChildEntity<T>> ResultSet<Event<C>> getEventsByChildId(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId, Query.PagingRequest paging) -
updateCheckpoint
- Specified by:
updateCheckpointin classEventRepositoy<T extends RootEntity>
-
isIdExist
public boolean isIdExist(java.lang.String id, java.lang.String tenantId)
-