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:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EntityAction(EventSource session, Object id, Object instance, EntityPersister persister)
Instantiate an action.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
afterDeserialize(EventSource session)
Reconnect to session after deserialization...void
beforeExecutions()
Called before executing any actions.int
compareTo(ComparableExecutable o)
protected EventSource
eventSource()
AfterTransactionCompletionProcess
getAfterTransactionCompletionProcess()
Get the after-transaction-completion process, if any, for this action.BeforeTransactionCompletionProcess
getBeforeTransactionCompletionProcess()
Get the before-transaction-completion process, if any, for this action.DelayedPostInsertIdentifier
getDelayedId()
String
getEntityName()
entity name accessorprotected FastSessionServices
getFastSessionServices()
Convenience method for all subclasses.Object
getId()
entity id accessorObject
getInstance()
entity instance accessorEntityPersister
getPersister()
entity persister accessorString
getPrimarySortClassifier()
This affect sorting order of the executables, when sorting is enabled.String[]
getPropertySpaces()
What spaces (tables) are affected by this action?Object
getSecondarySortIndex()
This affect sorting order of the executables, when sorting is enabled.EventSource
getSession()
originating session accessorprotected abstract boolean
hasPostCommitEventListeners()
boolean
isVeto()
protected boolean
needsAfterTransactionCompletion()
void
setVeto(boolean veto)
String
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 Detail
-
EntityAction
protected EntityAction(EventSource session, Object id, Object instance, EntityPersister persister)
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 Detail
-
isVeto
public boolean isVeto()
-
setVeto
public void setVeto(boolean veto)
-
getBeforeTransactionCompletionProcess
public BeforeTransactionCompletionProcess 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
public AfterTransactionCompletionProcess 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
public String getEntityName()
entity name accessor- Returns:
- The entity name
-
getId
public final Object getId()
entity id accessor- Returns:
- The entity id
-
getDelayedId
public final DelayedPostInsertIdentifier getDelayedId()
-
getInstance
public final Object getInstance()
entity instance accessor- Returns:
- The entity instance
-
getSession
public final EventSource getSession()
originating session accessor- Returns:
- The session from which this action originated.
-
getPersister
public final EntityPersister getPersister()
entity persister accessor- Returns:
- The entity persister
-
getPropertySpaces
public final String[] 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
-
compareTo
public int compareTo(ComparableExecutable o)
- Specified by:
compareTo
in interfaceComparable<ComparableExecutable>
-
getPrimarySortClassifier
public String 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
public Object 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
public void afterDeserialize(EventSource session)
Reconnect to session after deserialization...- Specified by:
afterDeserialize
in interfaceExecutable
- Parameters:
session
- The session being deserialized
-
eventSource
protected EventSource eventSource()
-
getFastSessionServices
protected FastSessionServices getFastSessionServices()
Convenience method for all subclasses.- Returns:
- the
FastSessionServices
instance from the SessionFactory.
-
-