Top Description Fields Constructors Methods
org.hibernate.action.internal

public Class EntityInsertAction

extends AbstractEntityInsertAction
Class Inheritance
Imports
org.hibernate.AssertionFailure, .HibernateException, org.hibernate.cache.spi.access.EntityDataAccess, org.hibernate.cache.spi.entry.CacheEntry, org.hibernate.engine.internal.Versioning, org.hibernate.engine.spi.EntityEntry, .EntityKey, .PersistenceContext, .SessionEventListenerManager, .SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.event.spi.EventManager, .HibernateMonitoringEvent, .EventSource, .PostCommitInsertEventListener, .PostInsertEvent, .PostInsertEventListener, .PreInsertEvent, .PreInsertEventListener, org.hibernate.event.service.spi.EventListenerGroup, org.hibernate.persister.entity.EntityPersister, org.hibernate.stat.internal.StatsHelper, org.hibernate.stat.spi.StatisticsImplementor

The action for performing an entity insertion, for entities not defined to use IDENTITY generation.
See Also
EntityIdentityInsertAction

Field Summary

Modifier and TypeField and Description
private Object
private Object

Constructor Summary

AccessConstructor and Description
public
EntityInsertAction(final Object
The entity identifier
id
,
final Object[]
The current (extracted) entity state
state
,
final Object
The entity instance
instance
,
final Object
The current entity version value
version
,
final EntityPersister
The entity's persister
persister
,
final boolean
Whether version incrementing is disabled.
isVersionIncrementDisabled
,
final EventSource
The session
session
)

Constructs an EntityInsertAction.

Method Summary

Modifier and TypeMethod and Description
protected boolean
protected boolean
public void
doAfterTransactionCompletion(boolean
Did the transaction complete successfully? True means it did.
success
,
SharedSessionContractImplementor
The session on which the transaction is completing.
session
)

Implements org.hibernate.action.spi.AfterTransactionCompletionProcess.doAfterTransactionCompletion.

Perform whatever processing is encapsulated here after completion of the transaction.
public void
execute()

Implements org.hibernate.action.spi.Executable.execute.

Execute this action.
protected Object
protected EntityKey
public Object
private void
protected boolean
protected boolean
public boolean
isEarlyInsert()

Implements abstract org.hibernate.action.internal.AbstractEntityInsertAction.isEarlyInsert.

Does this insert action need to be executed as soon as possible (e.g., to generate an ID)?
private PostInsertEvent
protected void
postCommitInsert(boolean success)

private void
protected void
protected boolean
protected void
protected void
setCacheEntry(Object cacheEntry)

public void
setVersion(Object version)

Inherited from org.hibernate.action.internal.AbstractEntityInsertAction:
addCollectionsByKeyToPersistenceContextafterDeserializefindNonNullableTransientEntitiesgetStatehandleNaturalIdPostSaveNotificationshandleNaturalIdPreSaveNotificationsmakeEntityManagedmarkExecutednullifyTransientReferencesIfNotAlready

Field Detail

cacheEntryback to summary
private Object cacheEntry
versionback to summary
private Object version

Constructor Detail

EntityInsertActionback to summary
public EntityInsertAction(final Object id, final Object[] state, final Object instance, final Object version, final EntityPersister persister, final boolean isVersionIncrementDisabled, final EventSource session)

Constructs an EntityInsertAction.

Parameters
id:Object

The entity identifier

state:Object[]

The current (extracted) entity state

instance:Object

The entity instance

version:Object

The current entity version value

persister:EntityPersister

The entity's persister

isVersionIncrementDisabled:boolean

Whether version incrementing is disabled.

session:EventSource

The session

Method Detail

cacheAfterInsertback to summary
protected boolean cacheAfterInsert(EntityDataAccess cache, Object ck)
cacheInsertback to summary
protected boolean cacheInsert(EntityPersister persister, Object ck)
doAfterTransactionCompletionback to summary
public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session) throws HibernateException

Implements org.hibernate.action.spi.AfterTransactionCompletionProcess.doAfterTransactionCompletion.

Doc from org.hibernate.action.spi.AfterTransactionCompletionProcess.doAfterTransactionCompletion.

Perform whatever processing is encapsulated here after completion of the transaction.

Parameters
success:boolean

Did the transaction complete successfully? True means it did.

session:SharedSessionContractImplementor

The session on which the transaction is completing.

Annotations
@Override
executeback to summary
public void execute() throws HibernateException

Implements org.hibernate.action.spi.Executable.execute.

Doc from org.hibernate.action.spi.Executable.execute.

Execute this action.

Annotations
@Override
Exceptions
HibernateException:
Indicates a problem during execution.
getCacheEntryback to summary
protected Object getCacheEntry()
getEntityKeyback to summary
protected EntityKey getEntityKey()

Implements abstract org.hibernate.action.internal.AbstractEntityInsertAction.getEntityKey.

Doc from org.hibernate.action.internal.AbstractEntityInsertAction.getEntityKey.

Returns the EntityKey.

Returns:EntityKey

the EntityKey.

Annotations
@Override
getVersionback to summary
public Object getVersion()
handleGeneratedPropertiesback to summary
private void handleGeneratedProperties(EntityEntry entry)
hasPostCommitEventListenersback to summary
protected boolean hasPostCommitEventListeners()

Implements abstract org.hibernate.action.internal.EntityAction.hasPostCommitEventListeners.

Annotations
@Override
isCachePutEnabledback to summary
protected boolean isCachePutEnabled(EntityPersister persister, SharedSessionContractImplementor session)
isEarlyInsertback to summary
public boolean isEarlyInsert()

Implements abstract org.hibernate.action.internal.AbstractEntityInsertAction.isEarlyInsert.

Doc from org.hibernate.action.internal.AbstractEntityInsertAction.isEarlyInsert.

Does this insert action need to be executed as soon as possible (e.g., to generate an ID)?

Returns:boolean

true, if it needs to be executed as soon as possible; false, otherwise.

Annotations
@Override
newPostInsertEventback to summary
private PostInsertEvent newPostInsertEvent()
postCommitInsertback to summary
protected void postCommitInsert(boolean success)
postCommitOnFailureback to summary
private void postCommitOnFailure(PostInsertEventListener listener, PostInsertEvent event)
postInsertback to summary
protected void postInsert()
preInsertback to summary
protected boolean preInsert()
putCacheIfNecessaryback to summary
protected void putCacheIfNecessary()
setCacheEntryback to summary
protected void setCacheEntry(Object cacheEntry)
setVersionback to summary
public void setVersion(Object version)