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

public Class EntityIdentityInsertAction

extends AbstractEntityInsertAction
Class Inheritance
Imports
org.hibernate.AssertionFailure, .HibernateException, org.hibernate.engine.spi.EntityKey, .PersistenceContext, .SharedSessionContractImplementor, org.hibernate.event.service.spi.EventListenerGroup, org.hibernate.event.spi.EventSource, .PostCommitInsertEventListener, .PostInsertEvent, .PostInsertEventListener, .PreInsertEvent, .PreInsertEventListener, org.hibernate.persister.entity.EntityPersister, org.hibernate.stat.spi.StatisticsImplementor

The action for performing entity insertions when entity is using IDENTITY column identifier generation
See Also
EntityInsertAction

Field Summary

Modifier and TypeField and Description
private final EntityKey
private EntityKey
private Object
private final boolean

Constructor Summary

AccessConstructor and Description
public
EntityIdentityInsertAction(final Object[]
The current (extracted) entity state
state
,
final Object
The entity instance
instance
,
final EntityPersister
The entity persister
persister
,
final boolean
Whether version incrementing is disabled
isVersionIncrementDisabled
,
final EventSource
The session
session
,
final boolean
Are we in a situation which allows the insertion to be delayed?
isDelayed
)

Constructs an EntityIdentityInsertAction

Method Summary

Modifier and TypeMethod and Description
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 EntityKey
private static DelayedPostInsertIdentifier
protected EntityKey
public final Object

Returns:

The generated identifier
getGeneratedId
()

Access to the generated identifier

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)?
public boolean
pack-priv PostInsertEvent
protected void
postCommitInsert(boolean success)

private void
protected void
protected boolean
protected void
protected void
setGeneratedId(Object generatedId)

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

Field Detail

delayedEntityKeyback to summary
private final EntityKey delayedEntityKey
entityKeyback to summary
private EntityKey entityKey
generatedIdback to summary
private Object generatedId
isDelayedback to summary
private final boolean isDelayed

Constructor Detail

EntityIdentityInsertActionback to summary
public EntityIdentityInsertAction(final Object[] state, final Object instance, final EntityPersister persister, final boolean isVersionIncrementDisabled, final EventSource session, final boolean isDelayed)

Constructs an EntityIdentityInsertAction

Parameters
state:Object[]

The current (extracted) entity state

instance:Object

The entity instance

persister:EntityPersister

The entity persister

isVersionIncrementDisabled:boolean

Whether version incrementing is disabled

session:EventSource

The session

isDelayed:boolean

Are we in a situation which allows the insertion to be delayed?

Exceptions
HibernateException:
Indicates an illegal state

Method Detail

doAfterTransactionCompletionback to summary
public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session)

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.
generateDelayedEntityKeyback to summary
protected EntityKey generateDelayedEntityKey()
generateDelayedPostInsertIdentifierback to summary
private static DelayedPostInsertIdentifier generateDelayedPostInsertIdentifier()
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
getGeneratedIdback to summary
public final Object getGeneratedId()

Access to the generated identifier

Returns:Object

The generated identifier

hasPostCommitEventListenersback to summary
protected boolean hasPostCommitEventListeners()

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

Annotations
@Override
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
needsAfterTransactionCompletionback to summary
public boolean needsAfterTransactionCompletion()

Overrides org.hibernate.action.internal.EntityAction.needsAfterTransactionCompletion.

Annotations
@Override
newPostInsertEventback to summary
pack-priv PostInsertEvent newPostInsertEvent()
postCommitInsertback to summary
protected void postCommitInsert(boolean success)
postCommitInsertOnFailureback to summary
private void postCommitInsertOnFailure(PostInsertEventListener listener, PostInsertEvent event)
postInsertback to summary
protected void postInsert()
preInsertback to summary
protected boolean preInsert()
setEntityKeyback to summary
protected void setEntityKey(EntityKey entityKey)
setGeneratedIdback to summary
protected void setGeneratedId(Object generatedId)