Package org.hibernate.engine.spi
Class EntityUniqueKey
- java.lang.Object
-
- org.hibernate.engine.spi.EntityUniqueKey
-
- All Implemented Interfaces:
Serializable
public class EntityUniqueKey extends Object implements Serializable
Used to uniquely key an entity instance in relation to a particular session by some unique property reference, as opposed to identifier.Uniqueing information consists of the entity name, the referenced property name, and the referenced property value.
- See Also:
EntityKey
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EntityUniqueKey(String entityName, String uniqueKeyName, Object key, Type keyType, SessionFactoryImplementor factory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EntityUniqueKey
deserialize(ObjectInputStream ois, SessionImplementor session)
Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.boolean
equals(@Nullable Object other)
static int
generateHashCode(String entityName, String uniqueKeyName, Type keyType, Object key, SessionFactoryImplementor factory)
String
getEntityName()
Object
getKey()
String
getUniqueKeyName()
int
hashCode()
void
serialize(ObjectOutputStream oos)
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.String
toString()
-
-
-
Constructor Detail
-
EntityUniqueKey
public EntityUniqueKey(String entityName, String uniqueKeyName, Object key, Type keyType, SessionFactoryImplementor factory)
-
-
Method Detail
-
getEntityName
public String getEntityName()
-
getKey
public Object getKey()
-
getUniqueKeyName
public String getUniqueKeyName()
-
generateHashCode
public static int generateHashCode(String entityName, String uniqueKeyName, Type keyType, Object key, SessionFactoryImplementor factory)
-
serialize
public void serialize(ObjectOutputStream oos) throws IOException
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.- Parameters:
oos
- The stream to which we should write the serial data.- Throws:
IOException
-
deserialize
public static EntityUniqueKey deserialize(ObjectInputStream ois, SessionImplementor session) throws IOException, ClassNotFoundException
Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.- Parameters:
ois
- The stream from which to read the entry.session
- The session being deserialized.- Returns:
- The deserialized EntityEntry
- Throws:
IOException
ClassNotFoundException
-
-