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 booleancacheAfterInsert(EntityDataAccess cache, Object ck) protected booleancacheInsert(EntityPersister persister, Object ck) voiddoAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session) Perform whatever processing is encapsulated here after completion of the transaction.voidexecute()Execute this action.protected Objectprotected EntityKeyReturns theEntityKey.protected ObjectgetRowId()protected booleanprotected booleanisCachePutEnabled(EntityPersister persister, SharedSessionContractImplementor session) booleanDoes this insert action need to be executed as soon as possible (e.g., to generate an ID)?protected voidpostCommitInsert(boolean success) protected voidprotected booleanprotected voidprotected voidsetCacheEntry(Object cacheEntry) voidsetVersion(Object version) Methods inherited from class org.hibernate.action.internal.AbstractEntityInsertAction
addCollectionsByKeyToPersistenceContext, afterDeserialize, findNonNullableTransientEntities, getState, handleNaturalIdPostSaveNotifications, handleNaturalIdPreSaveNotifications, makeEntityManaged, markExecuted, nullifyTransientReferencesIfNotAlreadyMethods inherited from class org.hibernate.action.internal.EntityAction
beforeExecutions, compareTo, eventSource, getAfterTransactionCompletionProcess, getBeforeTransactionCompletionProcess, getDelayedId, getEntityName, getEventListenerGroups, 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: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.
-
getRowId
- Specified by:
getRowIdin classAbstractEntityInsertAction
-
getEntityKey
Description copied from class:AbstractEntityInsertActionReturns theEntityKey.- Specified by:
getEntityKeyin classAbstractEntityInsertAction- Returns:
- the
EntityKey.
-
execute
Description copied from interface:ExecutableExecute 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:
hasPostCommitEventListenersin classEntityAction
-