Class 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 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()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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