Top Description Fields Constructors Methods
org.hibernate.event.spi

public abstract Class AbstractCollectionEvent

extends AbstractEvent
Class Inheritance
Known Direct Subclasses
org.hibernate.event.spi.InitializeCollectionEvent, org.hibernate.event.spi.PostCollectionRecreateEvent, org.hibernate.event.spi.PostCollectionRemoveEvent, org.hibernate.event.spi.PostCollectionUpdateEvent, org.hibernate.event.spi.PreCollectionRecreateEvent, org.hibernate.event.spi.PreCollectionRemoveEvent, org.hibernate.event.spi.PreCollectionUpdateEvent
Imports
java.io.Serializable, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.spi.CollectionEntry, .EntityEntry, org.hibernate.persister.collection.CollectionPersister

Defines a base class for events involving collections.
Author
Gail Badner

Field Summary

Modifier and TypeField and Description
private final Object
private final String
private final Serializable
private final PersistentCollection

Constructor Summary

AccessConstructor and Description
public
AbstractCollectionEvent(CollectionPersister collectionPersister, PersistentCollection
- the collection
collection
,
EventSource
- the Session source
source
,
Object
- the owner that is affected by this event; can be null if unavailable
affectedOwner
,
Serializable
- the ID for the owner that is affected by this event; can be null if unavailable that is affected by this event; can be null if unavailable
affectedOwnerId
)

Deprecated as a consequence of EventSource being deprecated.
Constructs an AbstractCollectionEvent object.

Method Summary

Modifier and TypeMethod and Description
protected static String
getAffectedOwnerEntityName(CollectionPersister collectionPersister, Object affectedOwner, EventSource source)

Deprecated as a consequence of EventSource being deprecated.
public String

Returns:

the entity name; if the owner is not in the PersistenceContext, the returned value may be a superclass name, instead of the actual class name
getAffectedOwnerEntityName
()

Get the entity name for the collection owner entity that is affected by this event.

public Serializable

Returns:

the affected owner ID; returns null if the ID cannot be obtained from the collection's loaded key (e.g., a property-ref is used for the collection and does not include the entity's ID)
getAffectedOwnerIdOrNull
()

Get the ID for the collection owner entity that is affected by this event.

public Object

Returns:

the affected owner; returns null if the entity is not in the persistence context (e.g., because the collection from a detached entity was moved to a new owner)
getAffectedOwnerOrNull
()

Get the collection owner entity that is affected by this event.

public PersistentCollection
protected static CollectionPersister
getLoadedCollectionPersister(PersistentCollection collection, EventSource source)

Deprecated as a consequence of EventSource being deprecated.
protected static Serializable
getLoadedOwnerIdOrNull(PersistentCollection collection, EventSource source)

Deprecated as a consequence of EventSource being deprecated.
protected static Object
getLoadedOwnerOrNull(PersistentCollection collection, EventSource source)

Deprecated as a consequence of EventSource being deprecated.
protected static Serializable
getOwnerIdOrNull(Object owner, EventSource source)

Deprecated as a consequence of EventSource being deprecated.
Inherited from org.hibernate.event.spi.AbstractEvent:
getSession

Field Detail

affectedOwnerback to summary
private final Object affectedOwner
affectedOwnerEntityNameback to summary
private final String affectedOwnerEntityName
affectedOwnerIdback to summary
private final Serializable affectedOwnerId
collectionback to summary
private final PersistentCollection collection

Constructor Detail

AbstractCollectionEventback to summary
public AbstractCollectionEvent(CollectionPersister collectionPersister, PersistentCollection collection, EventSource source, Object affectedOwner, Serializable affectedOwnerId)

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

Constructs an AbstractCollectionEvent object.

Parameters
collection:PersistentCollection

- the collection

source:EventSource

- the Session source

affectedOwner:Object

- the owner that is affected by this event; can be null if unavailable

affectedOwnerId:Serializable

- the ID for the owner that is affected by this event; can be null if unavailable that is affected by this event; can be null if unavailable

Method Detail

getAffectedOwnerEntityNameback to summary
protected static String getAffectedOwnerEntityName(CollectionPersister collectionPersister, Object affectedOwner, EventSource source)

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

getAffectedOwnerEntityNameback to summary
public String getAffectedOwnerEntityName()

Get the entity name for the collection owner entity that is affected by this event.

Returns:String

the entity name; if the owner is not in the PersistenceContext, the returned value may be a superclass name, instead of the actual class name

getAffectedOwnerIdOrNullback to summary
public Serializable getAffectedOwnerIdOrNull()

Get the ID for the collection owner entity that is affected by this event.

Returns:Serializable

the affected owner ID; returns null if the ID cannot be obtained from the collection's loaded key (e.g., a property-ref is used for the collection and does not include the entity's ID)

getAffectedOwnerOrNullback to summary
public Object getAffectedOwnerOrNull()

Get the collection owner entity that is affected by this event.

Returns:Object

the affected owner; returns null if the entity is not in the persistence context (e.g., because the collection from a detached entity was moved to a new owner)

getCollectionback to summary
public PersistentCollection getCollection()
getLoadedCollectionPersisterback to summary
protected static CollectionPersister getLoadedCollectionPersister(PersistentCollection collection, EventSource source)

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

getLoadedOwnerIdOrNullback to summary
protected static Serializable getLoadedOwnerIdOrNull(PersistentCollection collection, EventSource source)

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

getLoadedOwnerOrNullback to summary
protected static Object getLoadedOwnerOrNull(PersistentCollection collection, EventSource source)

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

getOwnerIdOrNullback to summary
protected static Serializable getOwnerIdOrNull(Object owner, EventSource source)

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.