Class EntityKey

  • All Implemented Interfaces:

    public final class EntityKey
    extends java.lang.Object
    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 (see equals(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.

    See Also:
    Serialized Form
    • Method Detail

      • isBatchLoadable

        public boolean isBatchLoadable()
      • getIdentifier

        public getIdentifier()
      • getEntityName

        public java.lang.String getEntityName()
      • equals

        public boolean equals​(java.lang.Object other)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • serialize

        public void serialize​( oos)
        Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.
        oos - The stream to which we should write the serial data.
        Throws: - Thrown by Java I/O
      • deserialize

        public static EntityKey deserialize​( ois,
                                            SessionFactoryImplementor sessionFactory)
        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
        Throws: - Thrown by Java I/O
        java.lang.ClassNotFoundException - Thrown by Java I/O