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
ConstructorsModifierConstructorDescriptionprotected
EntityAction
(EventSource session, Object id, Object instance, EntityPersister persister) Instantiate an action. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterDeserialize
(EventSource session) Reconnect to session after deserialization...void
Called before executing any actions.int
protected EventSource
Get the after-transaction-completion process, if any, for this action.Get the before-transaction-completion process, if any, for this action.entity name accessorprotected FastSessionServices
Convenience method for all subclasses.final Object
getId()
entity id accessorfinal Object
entity instance accessorfinal EntityPersister
entity 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 EventSource
originating session accessorprotected abstract boolean
boolean
isVeto()
protected boolean
void
setVeto
(boolean veto) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hibernate.action.spi.AfterTransactionCompletionProcess
doAfterTransactionCompletion
Methods 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:Executable
Get the before-transaction-completion process, if any, for this action.- Specified by:
getBeforeTransactionCompletionProcess
in interfaceExecutable
- Returns:
- The before-transaction-completion process, or null if we have no before-transaction-completion process
-
getAfterTransactionCompletionProcess
Description copied from interface:Executable
Get the after-transaction-completion process, if any, for this action.- Specified by:
getAfterTransactionCompletionProcess
in 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:Executable
What spaces (tables) are affected by this action?- Specified by:
getPropertySpaces
in interfaceExecutable
- Returns:
- The spaces affected by this action.
-
beforeExecutions
public void beforeExecutions()Description copied from interface:Executable
Called before executing any actions. Gives actions a chance to perform any preparation.- Specified by:
beforeExecutions
in interfaceExecutable
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ComparableExecutable>
-
getPrimarySortClassifier
Description copied from interface:ComparableExecutable
This affect sorting order of the executables, when sorting is enabled.- Specified by:
getPrimarySortClassifier
in interfaceComparableExecutable
- Returns:
- the primary sorting attribute; typically the entity name or collection role.
-
getSecondarySortIndex
Description copied from interface:ComparableExecutable
This affect sorting order of the executables, when sorting is enabled.- Specified by:
getSecondarySortIndex
in 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:
afterDeserialize
in interfaceExecutable
- Parameters:
session
- The session being deserialized
-
eventSource
-
getFastSessionServices
Convenience method for all subclasses.- Returns:
- the
FastSessionServices
instance from the SessionFactory.
-