Class DynamodbEventRepository<T extends RootEntity>
java.lang.Object
com.cloudimpl.outstack.runtime.EventRepositoy<T>
com.cloudimpl.outstack.spring.repo.DynamodbEventRepository<T>
- Type Parameters:
T-
- All Implemented Interfaces:
QueryOperations<T>
public class DynamodbEventRepository<T extends RootEntity> extends EventRepositoy<T>
- Author:
- nuwan
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringeventOwnerColumnstatic java.lang.StringeventTypeColumnstatic java.lang.StringjsonColumnstatic java.lang.StringlastSeqColumnstatic java.lang.StringownerIdColumnstatic java.lang.StringpartitionKeyColumnstatic java.lang.StringrangeKeyColumnFields inherited from class com.cloudimpl.outstack.runtime.EventRepositoy
resourceHelper, rootType, TID_PREFIX, version -
Constructor Summary
Constructors Constructor Description DynamodbEventRepository(com.amazonaws.services.dynamodbv2.AmazonDynamoDB client, com.amazonaws.services.dynamodbv2.document.DynamoDB dynamodb, 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, 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)<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
-
Field Details
-
partitionKeyColumn
public static final java.lang.String partitionKeyColumn- See Also:
- Constant Field Values
-
rangeKeyColumn
public static final java.lang.String rangeKeyColumn- See Also:
- Constant Field Values
-
jsonColumn
public static final java.lang.String jsonColumn- See Also:
- Constant Field Values
-
lastSeqColumn
public static final java.lang.String lastSeqColumn- See Also:
- Constant Field Values
-
eventTypeColumn
public static final java.lang.String eventTypeColumn- See Also:
- Constant Field Values
-
eventOwnerColumn
public static final java.lang.String eventOwnerColumn- See Also:
- Constant Field Values
-
ownerIdColumn
public static final java.lang.String ownerIdColumn- See Also:
- Constant Field Values
-
-
Constructor Details
-
DynamodbEventRepository
public DynamodbEventRepository(com.amazonaws.services.dynamodbv2.AmazonDynamoDB client, com.amazonaws.services.dynamodbv2.document.DynamoDB dynamodb, 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
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>
-
_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)
-