Class TemporalEntityKey

java.lang.Object
org.hibernate.engine.spi.EntityKey
org.hibernate.engine.spi.TemporalEntityKey
All Implemented Interfaces:
Serializable

public final class TemporalEntityKey extends EntityKey
An EntityKey for a temporal (historical) snapshot of an entity, loaded from an audit table at a specific changeset identifier.

The changeset identifier is included in equals()/hashCode() so that the persistence context naturally isolates entities at different points in time. Entities with a temporal key are always read-only.

Since:
7.4
See Also:
  • Constructor Details

    • TemporalEntityKey

      public TemporalEntityKey(@Nullable Object id, EntityPersister persister, Object changesetId)
      Construct a unique identifier for a temporal snapshot of an entity.
      Parameters:
      id - The entity id
      persister - The entity persister
      changesetId - The changeset identifier (must not be null)
  • Method Details

    • getChangesetId

      public Object getChangesetId()
      Description copied from class: EntityKey
      The audit changeset identifier for this key, or null for non-temporal entities. When non-null, this entity is a read-only historical snapshot.
      Overrides:
      getChangesetId in class EntityKey
    • isTemporal

      public boolean isTemporal()
      Description copied from class: EntityKey
      Whether this key refers to a temporal (historical) snapshot.
      Overrides:
      isTemporal in class EntityKey
    • toString

      public String toString()
      Overrides:
      toString in class EntityKey