Package org.hibernate.action.internal
Class EntityIdentityInsertAction
- java.lang.Object
-
- org.hibernate.action.internal.EntityAction
-
- org.hibernate.action.internal.AbstractEntityInsertAction
-
- org.hibernate.action.internal.EntityIdentityInsertAction
-
- All Implemented Interfaces:
Serializable
,Comparable<ComparableExecutable>
,AfterTransactionCompletionProcess
,Executable
,ComparableExecutable
public class EntityIdentityInsertAction extends AbstractEntityInsertAction
The action for performing entity insertions when entity is using IDENTITY column identifier generation- See Also:
EntityInsertAction
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EntityIdentityInsertAction(Object[] state, Object instance, EntityPersister persister, boolean isVersionIncrementDisabled, EventSource session, boolean isDelayed)
Constructs an EntityIdentityInsertAction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session)
Perform whatever processing is encapsulated here after completion of the transaction.void
execute()
Execute this action.protected EntityKey
generateDelayedEntityKey()
protected EntityKey
getEntityKey()
Returns theEntityKey
.Object
getGeneratedId()
Access to the generated identifierObject
getRowId()
protected boolean
hasPostCommitEventListeners()
boolean
isEarlyInsert()
Does this insert action need to be executed as soon as possible (e.g., to generate an ID)?boolean
needsAfterTransactionCompletion()
protected void
postCommitInsert(boolean success)
protected void
postInsert()
protected boolean
preInsert()
protected void
setEntityKey(EntityKey entityKey)
protected void
setGeneratedId(Object generatedId)
-
Methods inherited from class org.hibernate.action.internal.AbstractEntityInsertAction
addCollectionsByKeyToPersistenceContext, afterDeserialize, findNonNullableTransientEntities, getState, handleNaturalIdPostSaveNotifications, handleNaturalIdPreSaveNotifications, makeEntityManaged, markExecuted, nullifyTransientReferencesIfNotAlready
-
Methods inherited from class org.hibernate.action.internal.EntityAction
beforeExecutions, compareTo, eventSource, getAfterTransactionCompletionProcess, getBeforeTransactionCompletionProcess, getDelayedId, getEntityName, getFastSessionServices, getId, getInstance, getPersister, getPrimarySortClassifier, getPropertySpaces, getSecondarySortIndex, getSession, isVeto, setVeto, toString
-
-
-
-
Constructor Detail
-
EntityIdentityInsertAction
public EntityIdentityInsertAction(Object[] state, Object instance, EntityPersister persister, boolean isVersionIncrementDisabled, EventSource session, boolean isDelayed)
Constructs an EntityIdentityInsertAction- Parameters:
state
- The current (extracted) entity stateinstance
- The entity instancepersister
- The entity persisterisVersionIncrementDisabled
- Whether version incrementing is disabledsession
- The sessionisDelayed
- Are we in a situation which allows the insertion to be delayed?- Throws:
HibernateException
- Indicates an illegal state
-
-
Method Detail
-
execute
public void execute() throws HibernateException
Description copied from interface:Executable
Execute this action.- Throws:
HibernateException
- Indicates a problem during execution.
-
needsAfterTransactionCompletion
public boolean needsAfterTransactionCompletion()
- Overrides:
needsAfterTransactionCompletion
in classEntityAction
-
hasPostCommitEventListeners
protected boolean hasPostCommitEventListeners()
- Specified by:
hasPostCommitEventListeners
in classEntityAction
-
doAfterTransactionCompletion
public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session)
Description copied from interface:AfterTransactionCompletionProcess
Perform whatever processing is encapsulated here after completion of the transaction.- Parameters:
success
- Did the transaction complete successfully? True means it did.session
- The session on which the transaction is completing.
-
postInsert
protected void postInsert()
-
postCommitInsert
protected void postCommitInsert(boolean success)
-
preInsert
protected boolean preInsert()
-
getGeneratedId
public final Object getGeneratedId()
Access to the generated identifier- Returns:
- The generated identifier
-
setGeneratedId
protected void setGeneratedId(Object generatedId)
-
isEarlyInsert
public boolean isEarlyInsert()
Description copied from class:AbstractEntityInsertAction
Does this insert action need to be executed as soon as possible (e.g., to generate an ID)?- Specified by:
isEarlyInsert
in classAbstractEntityInsertAction
- Returns:
- true, if it needs to be executed as soon as possible; false, otherwise.
-
getEntityKey
protected EntityKey getEntityKey()
Description copied from class:AbstractEntityInsertAction
Returns theEntityKey
.- Specified by:
getEntityKey
in classAbstractEntityInsertAction
- Returns:
- the
EntityKey
.
-
getRowId
public Object getRowId()
- Specified by:
getRowId
in classAbstractEntityInsertAction
-
setEntityKey
protected void setEntityKey(EntityKey entityKey)
-
generateDelayedEntityKey
protected EntityKey generateDelayedEntityKey()
-
-