Package org.hibernate.action.internal
Class EntityInsertAction
java.lang.Object
org.hibernate.action.internal.EntityAction
org.hibernate.action.internal.AbstractEntityInsertAction
org.hibernate.action.internal.EntityInsertAction
- All Implemented Interfaces:
Serializable
,Comparable<ComparableExecutable>
,AfterTransactionCompletionProcess
,Executable
,ComparableExecutable
The action for performing an entity insertion, for entities not defined to use IDENTITY generation.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEntityInsertAction
(Object id, Object[] state, Object instance, Object version, EntityPersister persister, boolean isVersionIncrementDisabled, EventSource session) Constructs an EntityInsertAction. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
cacheAfterInsert
(EntityDataAccess cache, Object ck) protected boolean
cacheInsert
(EntityPersister persister, Object ck) void
doAfterTransactionCompletion
(boolean success, SharedSessionContractImplementor session) Perform whatever processing is encapsulated here after completion of the transaction.void
execute()
Execute this action.protected Object
protected EntityKey
Returns theEntityKey
.protected Object
getRowId()
protected boolean
protected boolean
isCachePutEnabled
(EntityPersister persister, SharedSessionContractImplementor session) boolean
Does this insert action need to be executed as soon as possible (e.g., to generate an ID)?protected void
postCommitInsert
(boolean success) protected void
protected boolean
protected void
protected void
setCacheEntry
(Object cacheEntry) void
setVersion
(Object version) 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, needsAfterTransactionCompletion, setVeto, toString
-
Constructor Details
-
EntityInsertAction
public EntityInsertAction(Object id, Object[] state, Object instance, Object version, EntityPersister persister, boolean isVersionIncrementDisabled, EventSource session) Constructs an EntityInsertAction.- Parameters:
id
- The entity identifierstate
- The current (extracted) entity stateinstance
- The entity instanceversion
- The current entity version valuepersister
- The entity's persisterisVersionIncrementDisabled
- Whether version incrementing is disabled.session
- The session
-
-
Method Details
-
getVersion
-
setVersion
-
getCacheEntry
-
setCacheEntry
-
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.
-
getRowId
- Specified by:
getRowId
in classAbstractEntityInsertAction
-
getEntityKey
Description copied from class:AbstractEntityInsertAction
Returns theEntityKey
.- Specified by:
getEntityKey
in classAbstractEntityInsertAction
- Returns:
- the
EntityKey
.
-
execute
Description copied from interface:Executable
Execute this action.- Throws:
HibernateException
- Indicates a problem during execution.
-
putCacheIfNecessary
protected void putCacheIfNecessary() -
cacheInsert
-
postInsert
protected void postInsert() -
postCommitInsert
protected void postCommitInsert(boolean success) -
preInsert
protected boolean preInsert() -
cacheAfterInsert
-
hasPostCommitEventListeners
protected boolean hasPostCommitEventListeners()- Specified by:
hasPostCommitEventListeners
in classEntityAction
-