Interface StateManagementSettings
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSpecifies the audit strategy for audited entities.static final StringSpecify aChangesetIdentifierSupplierwhich provides unique, monotonically increasing changeset ids for temporal data when using theTemporalTableStrategy.SINGLE_TABLEorTemporalTableStrategy.HISTORY_TABLEmapping strategy or for audited data.static final StringSpecifies the implementation strategy for temporal tables.static final StringUse transaction timestamps supplied by the database server'scurrent_timestampfunction instead ofInstant.now()to initialize the effectivity columns for temporal data when using theTemporalTableStrategy.SINGLE_TABLEorTemporalTableStrategy.HISTORY_TABLEmapping strategy.
-
Field Details
-
TEMPORAL_TABLE_STRATEGY
Specifies the implementation strategy for temporal tables.Accepts any of:
- an instance of
TemporalTableStrategy, or - the (case-insensitive) name of a
TemporalTableStrategy, for example,native,single_time, orhistory_table.
- Since:
- 7.4
- See Also:
- Default Value:
TemporalTableStrategy.SINGLE_TABLE
- an instance of
-
USE_SERVER_TRANSACTION_TIMESTAMPS
Use transaction timestamps supplied by the database server'scurrent_timestampfunction instead ofInstant.now()to initialize the effectivity columns for temporal data when using theTemporalTableStrategy.SINGLE_TABLEorTemporalTableStrategy.HISTORY_TABLEmapping strategy.Not recommended on database platforms with no way to obtain the timestamp of the start of the current transaction (most database except PostgreSQL-like databases).
This option cannot be used together with "hibernate.temporal.changeset_id_supplier".
By default, transaction timestamps are generated in memory.
- Since:
- 7.4
- See Also:
- Default Value:
false
-
CHANGESET_ID_SUPPLIER
Specify aChangesetIdentifierSupplierwhich provides unique, monotonically increasing changeset ids for temporal data when using theTemporalTableStrategy.SINGLE_TABLEorTemporalTableStrategy.HISTORY_TABLEmapping strategy or for audited data. A plainSupplieris also accepted for backward compatibility.The Java type of the changeset id is inferred from the type argument
Tin the instantiation ofChangesetIdentifierSupplier<T>implemented by the supplier class, and is used instead ofInstantfor the effectivity column mappings.By default, changeset ids are timestamps generated using
Instant.now().This option cannot be used together with "hibernate.temporal.use_server_transaction_timestamps".
- Since:
- 7.4
- See Also:
-
AUDIT_STRATEGY
Specifies the audit strategy for audited entities.Accepts any of:
- an instance of
AuditStrategy, or - the (case-insensitive) name of an
AuditStrategy, for example,defaultorvalidity.
The available strategies are:
default: each point-in-time query uses aMAX(REV)subquery to find the current audit row (no additional schema requirements), orvalidity: each audit row carries aREVENDcolumn marking when it was superseded; point-in-time queries use a simple range predicate (REV <= :changesetId AND (REVEND > :changesetId OR REVEND IS NULL)) instead of a subquery, which is significantly faster for large audit tables.
- Since:
- 7.4
- See Also:
- Default Value:
AuditStrategy.DEFAULT
- an instance of
-