Package org.hibernate.engine.spi
Class EntityUniqueKey
java.lang.Object
org.hibernate.engine.spi.EntityUniqueKey
- All Implemented Interfaces:
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:
-
Constructor Summary
ConstructorsConstructorDescriptionEntityUniqueKey
(String entityName, String uniqueKeyName, Object key, Type keyType, SessionFactoryImplementor factory) -
Method Summary
Modifier and TypeMethodDescriptionstatic EntityUniqueKey
deserialize
(ObjectInputStream ois, SessionImplementor session) Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.boolean
static int
generateHashCode
(String entityName, String uniqueKeyName, Type keyType, Object key, SessionFactoryImplementor factory) getKey()
int
hashCode()
void
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.toString()
-
Constructor Details
-
EntityUniqueKey
public EntityUniqueKey(String entityName, String uniqueKeyName, Object key, Type keyType, SessionFactoryImplementor factory)
-
-
Method Details
-
getEntityName
-
getKey
-
getUniqueKeyName
-
generateHashCode
public static int generateHashCode(String entityName, String uniqueKeyName, Type keyType, Object key, SessionFactoryImplementor factory) -
hashCode
public int hashCode() -
equals
-
toString
-
serialize
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
-