Package com.cloudimpl.outstack.runtime
Class EntityContextProvider.Transaction<R extends RootEntity>
java.lang.Object
com.cloudimpl.outstack.runtime.EntityQueryContextProvider.ReadOnlyTransaction<R>
com.cloudimpl.outstack.runtime.EntityContextProvider.Transaction<R>
- All Implemented Interfaces:
CRUDOperations,ITransaction<R>,QueryOperations<R>
- Enclosing class:
- EntityContextProvider<T extends RootEntity>
public static final class EntityContextProvider.Transaction<R extends RootEntity> extends EntityQueryContextProvider.ReadOnlyTransaction<R> implements CRUDOperations
-
Field Summary
Fields inherited from class com.cloudimpl.outstack.runtime.EntityQueryContextProvider.ReadOnlyTransaction
async, idGenerator, queryOperation, queryOperationSelector, rootTid, tenantId, validator, version -
Constructor Summary
Constructors Constructor Description Transaction(java.lang.Class<R> type, EntityProvider entityProvider, java.util.function.Supplier<java.lang.String> idGenerator, java.lang.String rootId, java.lang.String tenantId, QueryOperations<R> queryOperation, java.util.function.Consumer<java.lang.Object> validator, java.util.function.Function<java.lang.Class<? extends RootEntity>,QueryOperations<?>> queryOperationSelector, java.lang.String version, boolean async, java.util.function.Supplier<java.util.function.BiFunction<java.lang.String,java.lang.Object,reactor.core.publisher.Mono>> requestHandler) -
Method Summary
Modifier and Type Method Description voidcreate(Entity entity)voiddelete(Entity entity)ResultSet<R>getAllByRootType(java.lang.Class<R> rootType, java.lang.String tenantId, Query.PagingRequest paging)<T extends ChildEntity<R>>
ResultSet<T>getAllChildByType(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String tenantId, Query.PagingRequest pageable)<K> KgetAttachment()<T extends ChildEntity<R>>
java.util.Optional<T>getChildById(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String childId, java.lang.String tenantId)<C extends ChildEntity<R>, K extends Entity, Z extends EntityQueryContext>
ZgetContext(java.lang.Class<K> entityType)java.util.Map<java.lang.String,Entity>getDeletedEntities()java.util.Collection<Entity>getEntityList()java.util.List<Event>getEventList()InputMetaProvidergetInputMetaProvider()java.util.Map<java.lang.String,Entity>getRenameEntities()<K> KgetReply()java.util.Optional<R>getRootById(java.lang.Class<R> rootType, java.lang.String id, java.lang.String tenantId)protected <C extends ChildEntity<R>>
java.util.Optional<C>loadChildEntity(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId)<K extends Entity, C extends ChildEntity<R>>
java.util.Optional<K>loadEntity(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId)protected java.util.Optional<R>loadRootEntity(java.lang.Class<R> rootType, java.lang.String id, java.lang.String tenantId)protected voidpublishEvent(Event event)voidputEntity(Entity entity)voidrename(Entity oldEntity, Entity newEntity)voidsetAttachment(java.lang.Object attachment)protected EntityContextProvider.TransactionsetInputMetaProvider(InputMetaProvider inputMetaProvider)voidsetReply(java.lang.Object reply)voidupdate(Entity entity)Methods inherited from class com.cloudimpl.outstack.runtime.EntityQueryContextProvider.ReadOnlyTransaction
getEventsByChildId, getEventsByRootId, getRootTid, getTenantId, validateRootTidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cloudimpl.outstack.runtime.ITransaction
getTxList, isEntityRenamed
-
Constructor Details
-
Transaction
public Transaction(java.lang.Class<R> type, EntityProvider entityProvider, java.util.function.Supplier<java.lang.String> idGenerator, java.lang.String rootId, java.lang.String tenantId, QueryOperations<R> queryOperation, java.util.function.Consumer<java.lang.Object> validator, java.util.function.Function<java.lang.Class<? extends RootEntity>,QueryOperations<?>> queryOperationSelector, java.lang.String version, boolean async, java.util.function.Supplier<java.util.function.BiFunction<java.lang.String,java.lang.Object,reactor.core.publisher.Mono>> requestHandler)
-
-
Method Details
-
setReply
public void setReply(java.lang.Object reply)- Overrides:
setReplyin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getReply
public <K> K getReply()- Specified by:
getReplyin interfaceITransaction<R extends RootEntity>- Overrides:
getReplyin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getEventList
- Specified by:
getEventListin interfaceITransaction<R extends RootEntity>- Overrides:
getEventListin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
publishEvent
-
getInputMetaProvider
- Specified by:
getInputMetaProviderin interfaceITransaction<R extends RootEntity>- Overrides:
getInputMetaProviderin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
setInputMetaProvider
protected EntityContextProvider.Transaction setInputMetaProvider(InputMetaProvider inputMetaProvider) -
getContext
public <C extends ChildEntity<R>, K extends Entity, Z extends EntityQueryContext> Z getContext(java.lang.Class<K> entityType)- Specified by:
getContextin interfaceITransaction<R extends RootEntity>- Overrides:
getContextin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
loadEntity
public <K extends Entity, C extends ChildEntity<R>> java.util.Optional<K> loadEntity(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId) -
loadRootEntity
-
loadChildEntity
protected <C extends ChildEntity<R>> java.util.Optional<C> loadChildEntity(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId) -
putEntity
-
create
- Specified by:
createin interfaceCRUDOperations
-
update
- Specified by:
updatein interfaceCRUDOperations
-
delete
- Specified by:
deletein interfaceCRUDOperations
-
rename
- Specified by:
renamein interfaceCRUDOperations
-
getRootById
public java.util.Optional<R> getRootById(java.lang.Class<R> rootType, java.lang.String id, java.lang.String tenantId)- Specified by:
getRootByIdin interfaceQueryOperations<R extends RootEntity>- Overrides:
getRootByIdin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getChildById
public <T extends ChildEntity<R>> java.util.Optional<T> getChildById(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String childId, java.lang.String tenantId)- Specified by:
getChildByIdin interfaceQueryOperations<R extends RootEntity>- Overrides:
getChildByIdin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getAllChildByType
public <T extends ChildEntity<R>> ResultSet<T> getAllChildByType(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String tenantId, Query.PagingRequest pageable)- Specified by:
getAllChildByTypein interfaceQueryOperations<R extends RootEntity>- Overrides:
getAllChildByTypein classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getAllByRootType
public ResultSet<R> getAllByRootType(java.lang.Class<R> rootType, java.lang.String tenantId, Query.PagingRequest paging)- Specified by:
getAllByRootTypein interfaceQueryOperations<R extends RootEntity>- Overrides:
getAllByRootTypein classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
setAttachment
public void setAttachment(java.lang.Object attachment)- Specified by:
setAttachmentin interfaceITransaction<R extends RootEntity>- Overrides:
setAttachmentin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getAttachment
public <K> K getAttachment()- Specified by:
getAttachmentin interfaceITransaction<R extends RootEntity>- Overrides:
getAttachmentin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getEntityList
- Specified by:
getEntityListin interfaceITransaction<R extends RootEntity>- Overrides:
getEntityListin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getDeletedEntities
- Specified by:
getDeletedEntitiesin interfaceITransaction<R extends RootEntity>- Overrides:
getDeletedEntitiesin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-
getRenameEntities
- Specified by:
getRenameEntitiesin interfaceITransaction<R extends RootEntity>- Overrides:
getRenameEntitiesin classEntityQueryContextProvider.ReadOnlyTransaction<R extends RootEntity>
-