Package org.hibernate.engine.spi
Class EntityUniqueKey
- java.lang.Object
-
- org.hibernate.engine.spi.EntityUniqueKey
-
- All Implemented Interfaces:
java.io.Serializable
public class EntityUniqueKey extends java.lang.Object implements java.io.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(java.lang.String entityName, java.lang.String uniqueKeyName, java.lang.Object semiResolvedKey, Type keyType, EntityMode entityMode, SessionFactoryImplementor factory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EntityUniqueKey
deserialize(java.io.ObjectInputStream ois, SessionImplementor session)
Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.boolean
equals(java.lang.Object other)
int
generateHashCode(SessionFactoryImplementor factory)
java.lang.String
getEntityName()
java.lang.Object
getKey()
java.lang.String
getUniqueKeyName()
int
hashCode()
void
serialize(java.io.ObjectOutputStream oos)
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.java.lang.String
toString()
-
-
-
Constructor Detail
-
EntityUniqueKey
public EntityUniqueKey(java.lang.String entityName, java.lang.String uniqueKeyName, java.lang.Object semiResolvedKey, Type keyType, EntityMode entityMode, SessionFactoryImplementor factory)
-
-
Method Detail
-
getEntityName
public java.lang.String getEntityName()
-
getKey
public java.lang.Object getKey()
-
getUniqueKeyName
public java.lang.String getUniqueKeyName()
-
generateHashCode
public int generateHashCode(SessionFactoryImplementor factory)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
serialize
public void serialize(java.io.ObjectOutputStream oos) throws java.io.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:
java.io.IOException
-
deserialize
public static EntityUniqueKey deserialize(java.io.ObjectInputStream ois, SessionImplementor session) throws java.io.IOException, java.lang.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:
java.io.IOException
java.lang.ClassNotFoundException
-
-