Top Description Fields Constructors Methods
org.hibernate.action

public abstract Class EntityAction

extends Object
implements Executable, Serializable, Comparable, AfterTransactionCompletionProcess
Class Inheritance
All Implemented Interfaces
org.hibernate.action.AfterTransactionCompletionProcess, java.lang.Comparable, java.io.Serializable, org.hibernate.action.Executable
Known Direct Subclasses
org.hibernate.action.EntityDeleteAction, org.hibernate.action.EntityIdentityInsertAction, org.hibernate.action.EntityInsertAction, org.hibernate.action.EntityUpdateAction
Imports
org.hibernate.AssertionFailure, org.hibernate.engine.SessionImplementor, org.hibernate.persister.entity.EntityPersister, org.hibernate.pretty.MessageHelper, org.hibernate.util.StringHelper, java.io.IOException, .ObjectInputStream, .Serializable

Base class for actions relating to insert/update/delete of an entity instance.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private final String
private final Serializable
private final Object
private transient EntityPersister
private final SessionImplementor

Constructor Summary

AccessConstructor and Description
protected
EntityAction(SessionImplementor
The session from which this action is coming.
session
,
Serializable
The id of the entity
id
,
Object
The entiyt instance
instance
,
EntityPersister
The entity persister
persister
)

Instantiate an action.

Method Summary

Modifier and TypeMethod and Description
public void
beforeExecutions()

Implements org.hibernate.action.Executable.beforeExecutions.

Called before executing any actions.
public int
compareTo(Object
the object to be compared.
other
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.
public AfterTransactionCompletionProcess
getAfterTransactionCompletionProcess()

Implements org.hibernate.action.Executable.getAfterTransactionCompletionProcess.

Get the after-transaction-completion process, if any, for this action.
public BeforeTransactionCompletionProcess
getBeforeTransactionCompletionProcess()

Implements org.hibernate.action.Executable.getBeforeTransactionCompletionProcess.

Get the before-transaction-completion process, if any, for this action.
public String

Returns:

The entity name
getEntityName
()

entity name accessor

public final Serializable

Returns:

The entity id
getId
()

entity id accessor

public final Object

Returns:

The entity instance
getInstance
()

entity instance accessor

public final EntityPersister

Returns:

The entity persister
getPersister
()

entity persister accessor

public final Serializable[]
getPropertySpaces()

Implements org.hibernate.action.Executable.getPropertySpaces.

What spaces (tables) are affected by this action?
public final SessionImplementor

Returns:

The session from which this action originated.
getSession
()

originating session accessor

protected abstract boolean
public boolean
private void
readObject(ObjectInputStream
Thed object stream
ois
)

Serialization...

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

entityNameback to summary
private final String entityName
idback to summary
private final Serializable id
instanceback to summary
private final Object instance
persisterback to summary
private transient EntityPersister persister
sessionback to summary
private final SessionImplementor session

Constructor Detail

EntityActionback to summary
protected EntityAction(SessionImplementor session, Serializable id, Object instance, EntityPersister persister)

Instantiate an action.

Parameters
session:SessionImplementor

The session from which this action is coming.

id:Serializable

The id of the entity

instance:Object

The entiyt instance

persister:EntityPersister

The entity persister

Method Detail

beforeExecutionsback to summary
public void beforeExecutions()

Implements org.hibernate.action.Executable.beforeExecutions.

Doc from org.hibernate.action.Executable.beforeExecutions.

Called before executing any actions. Gives actions a chance to perform any preparation.

compareToback to summary
public int compareTo(Object other)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
other:Object

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

getAfterTransactionCompletionProcessback to summary
public AfterTransactionCompletionProcess getAfterTransactionCompletionProcess()

Implements org.hibernate.action.Executable.getAfterTransactionCompletionProcess.

Doc from org.hibernate.action.Executable.getAfterTransactionCompletionProcess.

Get the after-transaction-completion process, if any, for this action.

Returns:AfterTransactionCompletionProcess

The after-transaction-completion process, or null if we have no after-transaction-completion process

getBeforeTransactionCompletionProcessback to summary
public BeforeTransactionCompletionProcess getBeforeTransactionCompletionProcess()

Implements org.hibernate.action.Executable.getBeforeTransactionCompletionProcess.

Doc from org.hibernate.action.Executable.getBeforeTransactionCompletionProcess.

Get the before-transaction-completion process, if any, for this action.

Returns:BeforeTransactionCompletionProcess

The before-transaction-completion process, or null if we have no before-transaction-completion process

getEntityNameback to summary
public String getEntityName()

entity name accessor

Returns:String

The entity name

getIdback to summary
public final Serializable getId()

entity id accessor

Returns:Serializable

The entity id

getInstanceback to summary
public final Object getInstance()

entity instance accessor

Returns:Object

The entity instance

getPersisterback to summary
public final EntityPersister getPersister()

entity persister accessor

Returns:EntityPersister

The entity persister

getPropertySpacesback to summary
public final Serializable[] getPropertySpaces()

Implements org.hibernate.action.Executable.getPropertySpaces.

Doc from org.hibernate.action.Executable.getPropertySpaces.

What spaces (tables) are affected by this action?

Returns:Serializable[]

The spaces affected by this action.

getSessionback to summary
public final SessionImplementor getSession()

originating session accessor

Returns:SessionImplementor

The session from which this action originated.

hasPostCommitEventListenersback to summary
protected abstract boolean hasPostCommitEventListeners()
needsAfterTransactionCompletionback to summary
public boolean needsAfterTransactionCompletion()
readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException

Serialization...

Parameters
ois:ObjectInputStream

Thed object stream

Exceptions
IOException:
Problem performing the default stream reading
ClassNotFoundException:
Problem performing the default stream reading
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.