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
ConstructorDescriptionEntityTransactionContextImpl
(SessionFactoryManager sessionFactoryManager, EntityFacadeListenerManager entityFacadeListenerManager, EntityValidationService entityValidationService, AfterCommitListener afterCommitListener, DataModel dataModel) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCreatedEntity
(Entity entity) Add a newly created entity which should be automatically saved before transaction commit.void
addDeletedEntity
(Entity entity) Entity which should be deleted before transaction commit (and after inserts).void
clear()
Remove all cached data for the current session.void
Execute 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:EntityTransactionContext
Add a newly created entity which should be automatically saved before transaction commit.- Specified by:
addCreatedEntity
in interfaceEntityTransactionContext
-
addDeletedEntity
Description copied from interface:EntityTransactionContext
Entity which should be deleted before transaction commit (and after inserts).- Specified by:
addDeletedEntity
in interfaceEntityTransactionContext
-
executeEntityOperations
public void executeEntityOperations()Description copied from interface:EntityTransactionContext
Execute all tracked entity operations (insert/delete) for the current session/transaction.- Specified by:
executeEntityOperations
in interfaceEntityTransactionContext
-
clear
public void clear()Description copied from interface:EntityTransactionContext
Remove all cached data for the current session.- Specified by:
clear
in interfaceEntityTransactionContext
-