Annotation Interface Changelog


@Documented @Incubating @Retention(RUNTIME) @Target(TYPE) public @interface Changelog
Marks an entity as the changelog entity for audit logging. The annotated class must also be annotated @Entity and must have: Optionally, a @ModifiedEntities property may be declared to enable cross-type changeset queries via AuditLog.

The changelog entity is responsible for initializing its own @Timestamp field, for example, via CreationTimestamp, in the constructor, or in a ChangesetListener.

When a class annotated with @Changelog is found in the domain model, it is automatically configured as the changeset id supplier, and it is not necessary to explicitly set the property "hibernate.temporal.changeset_id_supplier".

Only one entity may be annotated with @Changelog.

Since:
7.4
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Marks the property that holds the changeset identifier in a @Changelog.
    static @interface 
    Marks a Set<String> property of a @Changelog that holds the names of entity types modified in each changeset.
    static @interface 
    Marks the property that holds the changeset timestamp in a @Changelog.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    An optional ChangesetListener implementation that will be called after the changelog entity is created, to populate custom fields (e.g.
  • Element Details

    • listener

      Class<? extends ChangesetListener> listener
      An optional ChangesetListener implementation that will be called after the changelog entity is created, to populate custom fields (e.g. user, comment).
      Default:
      org.hibernate.audit.ChangesetListener.class