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 voiddoAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session)Perform whatever processing is encapsulated here after completion of the transaction.voidexecute()Execute this action.protected EntityKeygenerateDelayedEntityKey()protected EntityKeygetEntityKey()Returns theEntityKey.ObjectgetGeneratedId()Access to the generated identifierObjectgetRowId()protected booleanhasPostCommitEventListeners()booleanisEarlyInsert()Does this insert action need to be executed as soon as possible (e.g., to generate an ID)?booleanneedsAfterTransactionCompletion()protected voidpostCommitInsert(boolean success)protected voidpostInsert()protected booleanpreInsert()protected voidsetEntityKey(EntityKey entityKey)protected voidsetGeneratedId(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 HibernateExceptionDescription copied from interface:ExecutableExecute this action.- Throws:
HibernateException- Indicates a problem during execution.
-
needsAfterTransactionCompletion
public boolean needsAfterTransactionCompletion()
- Overrides:
needsAfterTransactionCompletionin classEntityAction
-
hasPostCommitEventListeners
protected boolean hasPostCommitEventListeners()
- Specified by:
hasPostCommitEventListenersin classEntityAction
-
doAfterTransactionCompletion
public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session)Description copied from interface:AfterTransactionCompletionProcessPerform 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:AbstractEntityInsertActionDoes this insert action need to be executed as soon as possible (e.g., to generate an ID)?- Specified by:
isEarlyInsertin classAbstractEntityInsertAction- Returns:
- true, if it needs to be executed as soon as possible; false, otherwise.
-
getEntityKey
protected EntityKey getEntityKey()
Description copied from class:AbstractEntityInsertActionReturns theEntityKey.- Specified by:
getEntityKeyin classAbstractEntityInsertAction- Returns:
- the
EntityKey.
-
getRowId
public Object getRowId()
- Specified by:
getRowIdin classAbstractEntityInsertAction
-
setEntityKey
protected void setEntityKey(EntityKey entityKey)
-
generateDelayedEntityKey
protected EntityKey generateDelayedEntityKey()
-
-