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
The action for performing entity insertions when entity is using IDENTITY column identifier generation
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEntityIdentityInsertAction
(Object[] state, Object instance, EntityPersister persister, boolean isVersionIncrementDisabled, EventSource session, boolean isDelayed) Constructs an EntityIdentityInsertAction -
Method Summary
Modifier and TypeMethodDescriptionvoid
doAfterTransactionCompletion
(boolean success, SharedSessionContractImplementor session) Perform whatever processing is encapsulated here after completion of the transaction.void
execute()
Execute this action.protected EntityKey
protected EntityKey
Returns theEntityKey
.final Object
Access to the generated identifiergetRowId()
protected boolean
boolean
Does this insert action need to be executed as soon as possible (e.g., to generate an ID)?boolean
protected void
postCommitInsert
(boolean success) protected void
protected boolean
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 Details
-
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 Details
-
execute
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
-
postInsert
protected void postInsert() -
postCommitInsert
protected void postCommitInsert(boolean success) -
preInsert
protected boolean preInsert() -
getGeneratedId
Access to the generated identifier- Returns:
- The generated identifier
-
setGeneratedId
-
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
Description copied from class:AbstractEntityInsertAction
Returns theEntityKey
.- Specified by:
getEntityKey
in classAbstractEntityInsertAction
- Returns:
- the
EntityKey
.
-
getRowId
- Specified by:
getRowId
in classAbstractEntityInsertAction
-
setEntityKey
-
generateDelayedEntityKey
-