类 EntityKey
- java.lang.Object
-
- org.hibernate.engine.spi.EntityKey
-
- 所有已实现的接口:
Serializable
public final class EntityKey extends Object implements Serializable
Uniquely identifies of an entity instance in a particular Session by identifier. Note that it's only safe to be used within the scope of a Session: it doesn't consider for example the tenantId as part of the equality definition. Information used to determine uniqueness consists of the entity-name and the identifier value (seeequals(java.lang.Object)). Performance considerations: lots of instances of this type are created at runtime. Make sure each one is as small as possible by storing just the essential needed.- 作者:
- Gavin King, Sanne Grinovero
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 EntityKey(Serializable id, EntityPersister persister)Construct a unique identifier for an entity class instance.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static EntityKeydeserialize(ObjectInputStream ois, SessionFactoryImplementor sessionFactory)Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.booleanequals(Object other)StringgetEntityName()SerializablegetIdentifier()EntityPersistergetPersister()inthashCode()booleanisBatchLoadable()voidserialize(ObjectOutputStream oos)Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.StringtoString()
-
-
-
构造器详细资料
-
EntityKey
public EntityKey(Serializable id, EntityPersister persister)
Construct a unique identifier for an entity class instance. NOTE : This signature has changed to accommodate both entity mode and multi-tenancy, both of which relate to the Session to which this key belongs. To help minimize the impact of these changes in the future, theSharedSessionContractImplementor.generateEntityKey(java.io.Serializable, org.hibernate.persister.entity.EntityPersister)method was added to hide the session-specific changes.- 参数:
id- The entity idpersister- The entity persister
-
-
方法详细资料
-
isBatchLoadable
public boolean isBatchLoadable()
-
getIdentifier
public Serializable getIdentifier()
-
getEntityName
public String getEntityName()
-
getPersister
public EntityPersister getPersister()
-
serialize
public void serialize(ObjectOutputStream oos) throws IOException
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.- 参数:
oos- The stream to which we should write the serial data.- 抛出:
IOException- Thrown by Java I/O
-
deserialize
public static EntityKey deserialize(ObjectInputStream ois, SessionFactoryImplementor sessionFactory) throws IOException, ClassNotFoundException
Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.- 参数:
ois- The stream from which to read the entry.sessionFactory- The SessionFactory owning the Session being deserialized.- 返回:
- The deserialized EntityEntry
- 抛出:
IOException- Thrown by Java I/OClassNotFoundException- Thrown by Java I/O
-
-