Package org.hibernate.action.internal
Class EntityAction
java.lang.Object
org.hibernate.action.internal.EntityAction
- All Implemented Interfaces:
Serializable,Comparable<ComparableExecutable>,AfterTransactionCompletionProcess,Executable,ComparableExecutable
- Direct Known Subclasses:
AbstractEntityInsertAction,EntityDeleteAction,EntityUpdateAction
public abstract class EntityAction
extends Object
implements ComparableExecutable, AfterTransactionCompletionProcess
Base class for actions relating to insert/update/delete of an entity
instance.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityAction(EventSource session, Object id, Object instance, EntityPersister persister) Instantiate an action. -
Method Summary
Modifier and TypeMethodDescriptionvoidafterDeserialize(EventSource session) Reconnect to session after deserialization...voidCalled before executing any actions.intcompareTo(ComparableExecutable executable) protected final EventSourceGet the after-transaction-completion process, if any, for this action.Get the before-transaction-completion process, if any, for this action.entity name accessorprotected EventListenerGroupsConvenience method for all subclasses.final ObjectgetId()entity id accessorfinal Objectentity instance accessorfinal EntityPersisterentity persister accessorThis affect sorting order of the executables, when sorting is enabled.final String[]What spaces (tables) are affected by this action?This affect sorting order of the executables, when sorting is enabled.final EventSourceoriginating session accessorprotected abstract booleanbooleanisVeto()protected booleanvoidsetVeto(boolean veto) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.action.spi.AfterTransactionCompletionProcess
doAfterTransactionCompletionMethods inherited from interface org.hibernate.action.spi.Executable
execute
-
Constructor Details
-
EntityAction
Instantiate an action.- Parameters:
session- The session from which this action is coming.id- The id of the entityinstance- The entity instancepersister- The entity persister
-
-
Method Details
-
isVeto
public boolean isVeto() -
setVeto
public void setVeto(boolean veto) -
getBeforeTransactionCompletionProcess
Description copied from interface:ExecutableGet the before-transaction-completion process, if any, for this action.- Specified by:
getBeforeTransactionCompletionProcessin interfaceExecutable- Returns:
- The before-transaction-completion process, or null if we have no before-transaction-completion process
-
getAfterTransactionCompletionProcess
Description copied from interface:ExecutableGet the after-transaction-completion process, if any, for this action.- Specified by:
getAfterTransactionCompletionProcessin interfaceExecutable- Returns:
- The after-transaction-completion process, or null if we have no after-transaction-completion process
-
hasPostCommitEventListeners
protected abstract boolean hasPostCommitEventListeners() -
needsAfterTransactionCompletion
protected boolean needsAfterTransactionCompletion() -
getEntityName
entity name accessor- Returns:
- The entity name
-
getId
entity id accessor- Returns:
- The entity id
-
getDelayedId
-
getInstance
entity instance accessor- Returns:
- The entity instance
-
getSession
originating session accessor- Returns:
- The session from which this action originated.
-
getPersister
entity persister accessor- Returns:
- The entity persister
-
getPropertySpaces
Description copied from interface:ExecutableWhat spaces (tables) are affected by this action?- Specified by:
getPropertySpacesin interfaceExecutable- Returns:
- The spaces affected by this action.
-
beforeExecutions
public void beforeExecutions()Description copied from interface:ExecutableCalled before executing any actions. Gives actions a chance to perform any preparation.- Specified by:
beforeExecutionsin interfaceExecutable
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<ComparableExecutable>
-
getPrimarySortClassifier
Description copied from interface:ComparableExecutableThis affect sorting order of the executables, when sorting is enabled.- Specified by:
getPrimarySortClassifierin interfaceComparableExecutable- Returns:
- the primary sorting attribute; typically the entity name or collection role.
-
getSecondarySortIndex
Description copied from interface:ComparableExecutableThis affect sorting order of the executables, when sorting is enabled.- Specified by:
getSecondarySortIndexin interfaceComparableExecutable- Returns:
- the secondary sorting attribute, applied when getPrimarySortClassifier matches during a comparison; typically the entity key or collection key.
-
afterDeserialize
Reconnect to session after deserialization...- Specified by:
afterDeserializein interfaceExecutable- Parameters:
session- The session being deserialized
-
eventSource
-
getEventListenerGroups
Convenience method for all subclasses.- Returns:
- the
EventListenerGroupsinstance from theSessionFactory.
-