Class EntityTransactionContextImpl
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.cascade.EntityTransactionContextImpl
- All Implemented Interfaces:
EntityTransactionContext
@Component
public class EntityTransactionContextImpl
extends Object
implements EntityTransactionContext
Tracks all newly created entities per session/transaction and inserts them using the
EntityInsertActionResolver-
Constructor Summary
ConstructorsConstructorDescriptionEntityTransactionContextImpl(SessionFactoryManager sessionFactoryManager, EntityFacadeListenerManager entityFacadeListenerManager, EntityValidationService entityValidationService, AfterCommitListener afterCommitListener, DataModel dataModel) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCreatedEntity(Entity entity) Add a newly created entity which should be automatically saved before transaction commit.voidaddDeletedEntity(Entity entity) Entity which should be deleted before transaction commit (and after inserts).voidclear()Remove all cached data for the current session.voidExecute all tracked entity operations (insert/delete) for the current session/transaction.
-
Constructor Details
-
EntityTransactionContextImpl
public EntityTransactionContextImpl(SessionFactoryManager sessionFactoryManager, EntityFacadeListenerManager entityFacadeListenerManager, @Lazy EntityValidationService entityValidationService, AfterCommitListener afterCommitListener, DataModel dataModel)
-
-
Method Details
-
addCreatedEntity
Description copied from interface:EntityTransactionContextAdd a newly created entity which should be automatically saved before transaction commit.- Specified by:
addCreatedEntityin interfaceEntityTransactionContext
-
addDeletedEntity
Description copied from interface:EntityTransactionContextEntity which should be deleted before transaction commit (and after inserts).- Specified by:
addDeletedEntityin interfaceEntityTransactionContext
-
executeEntityOperations
public void executeEntityOperations()Description copied from interface:EntityTransactionContextExecute all tracked entity operations (insert/delete) for the current session/transaction.- Specified by:
executeEntityOperationsin interfaceEntityTransactionContext
-
clear
public void clear()Description copied from interface:EntityTransactionContextRemove all cached data for the current session.- Specified by:
clearin interfaceEntityTransactionContext
-