类 AbstractCollectionEvent
- java.lang.Object
-
- org.hibernate.event.spi.AbstractEvent
-
- org.hibernate.event.spi.AbstractCollectionEvent
-
- 所有已实现的接口:
Serializable
- 直接已知子类:
InitializeCollectionEvent,PostCollectionRecreateEvent,PostCollectionRemoveEvent,PostCollectionUpdateEvent,PreCollectionRecreateEvent,PreCollectionRemoveEvent,PreCollectionUpdateEvent
public abstract class AbstractCollectionEvent extends AbstractEvent
Defines a base class for events involving collections.- 作者:
- Gail Badner
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 AbstractCollectionEvent(CollectionPersister collectionPersister, PersistentCollection collection, EventSource source, Object affectedOwner, Serializable affectedOwnerId)Constructs an AbstractCollectionEvent object.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 StringgetAffectedOwnerEntityName()Get the entity name for the collection owner entity that is affected by this event.protected static StringgetAffectedOwnerEntityName(CollectionPersister collectionPersister, Object affectedOwner, EventSource source)SerializablegetAffectedOwnerIdOrNull()Get the ID for the collection owner entity that is affected by this event.ObjectgetAffectedOwnerOrNull()Get the collection owner entity that is affected by this event.PersistentCollectiongetCollection()protected static CollectionPersistergetLoadedCollectionPersister(PersistentCollection collection, EventSource source)protected static SerializablegetLoadedOwnerIdOrNull(PersistentCollection collection, EventSource source)protected static ObjectgetLoadedOwnerOrNull(PersistentCollection collection, EventSource source)protected static SerializablegetOwnerIdOrNull(Object owner, EventSource source)-
从类继承的方法 org.hibernate.event.spi.AbstractEvent
getSession
-
-
-
-
构造器详细资料
-
AbstractCollectionEvent
public AbstractCollectionEvent(CollectionPersister collectionPersister, PersistentCollection collection, EventSource source, Object affectedOwner, Serializable affectedOwnerId)
Constructs an AbstractCollectionEvent object.- 参数:
collection- - the collectionsource- - the Session sourceaffectedOwner- - the owner that is affected by this event; can be null if unavailableaffectedOwnerId- - 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
-
-
方法详细资料
-
getLoadedCollectionPersister
protected static CollectionPersister getLoadedCollectionPersister(PersistentCollection collection, EventSource source)
-
getLoadedOwnerOrNull
protected static Object getLoadedOwnerOrNull(PersistentCollection collection, EventSource source)
-
getLoadedOwnerIdOrNull
protected static Serializable getLoadedOwnerIdOrNull(PersistentCollection collection, EventSource source)
-
getOwnerIdOrNull
protected static Serializable getOwnerIdOrNull(Object owner, EventSource source)
-
getAffectedOwnerEntityName
protected static String getAffectedOwnerEntityName(CollectionPersister collectionPersister, Object affectedOwner, EventSource source)
-
getCollection
public PersistentCollection getCollection()
-
getAffectedOwnerOrNull
public Object getAffectedOwnerOrNull()
Get the collection owner entity that is affected by this event.- 返回:
- 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)
-
getAffectedOwnerIdOrNull
public Serializable getAffectedOwnerIdOrNull()
Get the ID for the collection owner entity that is affected by this event.- 返回:
- 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)
-
getAffectedOwnerEntityName
public String getAffectedOwnerEntityName()
Get the entity name for the collection owner entity that is affected by this event.- 返回:
- 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
-
-