public abstract class

AbstractCollectionEvent

extends AbstractEvent
java.lang.Object
   ↳ org.hibernate.event.AbstractEvent
     ↳ org.hibernate.event.AbstractCollectionEvent
Known Direct Subclasses

Class Overview

Defines a base class for events involving collections.

Summary

Public Constructors
AbstractCollectionEvent(CollectionPersister collectionPersister, PersistentCollection collection, EventSource source, Object affectedOwner, Serializable affectedOwnerId)
Constructs an AbstractCollectionEvent object.
Public Methods
String getAffectedOwnerEntityName()
Get the entity name for the collection owner entity that is affected by this event.
Serializable getAffectedOwnerIdOrNull()
Get the ID for the collection owner entity that is affected by this event.
Object getAffectedOwnerOrNull()
Get the collection owner entity that is affected by this event.
PersistentCollection getCollection()
Protected Methods
static String getAffectedOwnerEntityName(CollectionPersister collectionPersister, Object affectedOwner, EventSource source)
static CollectionPersister getLoadedCollectionPersister(PersistentCollection collection, EventSource source)
static Serializable getLoadedOwnerIdOrNull(PersistentCollection collection, EventSource source)
static Object getLoadedOwnerOrNull(PersistentCollection collection, EventSource source)
static Serializable getOwnerIdOrNull(Object owner, EventSource source)
[Expand]
Inherited Methods
From class org.hibernate.event.AbstractEvent
From class java.lang.Object

Public Constructors

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

Constructs an AbstractCollectionEvent object.

Parameters
collection - the collection
source - the Session source
affectedOwner - the owner that is affected by this event; can be null if unavailable
affectedOwnerId - 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

Public Methods

public String getAffectedOwnerEntityName ()

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

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

public Serializable getAffectedOwnerIdOrNull ()

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

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)

public Object getAffectedOwnerOrNull ()

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

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)

public PersistentCollection getCollection ()

Protected Methods

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

protected static CollectionPersister getLoadedCollectionPersister (PersistentCollection collection, EventSource source)

protected static Serializable getLoadedOwnerIdOrNull (PersistentCollection collection, EventSource source)

protected static Object getLoadedOwnerOrNull (PersistentCollection collection, EventSource source)

protected static Serializable getOwnerIdOrNull (Object owner, EventSource source)