Class DefaultTemporalTableSupport
java.lang.Object
org.hibernate.dialect.temporal.DefaultTemporalTableSupport
- All Implemented Interfaces:
TemporalTableSupport
- Direct Known Subclasses:
DB2TemporalTableSupport, MySQLTemporalTableSupport, OracleTemporalTableSupport, PostgreSQLTemporalTableSupport, SQLServerTemporalTableSupport
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTemporalTableAuxiliaryObjects(TemporalTableStrategy strategy, Table table, Database database, boolean partitioned, String currentPartitionName, String historyPartitionName) Register any auxiliary database objects required for the given temporary table and strategy.booleanShould we create acheckconstraint to enforce effectivity constraints? (That starting timestamps precede ending timestamps.) This is typically not needed for native temporal tables.getAsOfOperator(TemporalTableStrategy strategy) The operator used to specify a temporal instant for querying historical data.The recommended temporal table strategy for this dialect.getExtraTemporalTableDeclarations(TemporalTableStrategy strategy, String rowStartColumn, String rowEndColumn, boolean partitioned) Any extra declarations required as part of thecreate tablestatement for a temporal table.intThe column precision to use for effectivity columns of native temporal tables when the precision is not explicitly specified.intThe column type to use for effectivity columns of temporal tables.Column options for a native implementation of exclusion from temporal versioning.getTemporalTableOptions(TemporalTableStrategy strategy, String rowEndColumnName, boolean partitioned, String currentPartitionName, String historyPartitionName) Table options to use for temporal tables, used to specify system versioning or table partitioning.booleanDoes this dialect natively support SQL 2011-style temporal tables?booleanDo we support partitioning temporal tables in this dialect?booleansuppressesTemporalTablePrimaryKeys(boolean partitioned) Do we need to suppress creation of the primary key constraint on a temporal table?booleanuseAsOfOperator(TemporalTableStrategy strategy) Should be use thefor system_time as ofoperator when querying temporal tables? We usually only use it for querying native temporal tables at a historical instant, but in Oracle we use it all the time.booleanuseTemporalRestriction(LoadQueryInfluencers influencers) Should we use temporal restrictions on therow startandrow endcolumns when querying temporal tables? We usually use them unless we are using native temporal tables, but on Oracle we never use them.
-
Constructor Details
-
DefaultTemporalTableSupport
-
-
Method Details
-
supportsNativeTemporalTables
public boolean supportsNativeTemporalTables()Description copied from interface:TemporalTableSupportDoes this dialect natively support SQL 2011-style temporal tables?- Specified by:
supportsNativeTemporalTablesin interfaceTemporalTableSupport- See Also:
-
getTemporalColumnType
public int getTemporalColumnType()Description copied from interface:TemporalTableSupportThe column type to use for effectivity columns of temporal tables. The default implementation returnsTIMESTAMP.- Specified by:
getTemporalColumnTypein interfaceTemporalTableSupport
-
getTemporalColumnPrecision
public int getTemporalColumnPrecision()Description copied from interface:TemporalTableSupportThe column precision to use for effectivity columns of native temporal tables when the precision is not explicitly specified. The default implementation returns the default timestamp precision for this dialect.- Specified by:
getTemporalColumnPrecisionin interfaceTemporalTableSupport- See Also:
-
getTemporalTableOptions
public String getTemporalTableOptions(TemporalTableStrategy strategy, String rowEndColumnName, boolean partitioned, String currentPartitionName, String historyPartitionName) Description copied from interface:TemporalTableSupportTable options to use for temporal tables, used to specify system versioning or table partitioning.- Specified by:
getTemporalTableOptionsin interfaceTemporalTableSupport- Parameters:
strategy- The temporal table strategyrowEndColumnName- The name of therow endcolumn specified viaTemporal.rowEnd()partitioned- Is partitioning requestedcurrentPartitionName- The current partition name, if specifiedhistoryPartitionName- The history partition name, if specified- Returns:
- The options, or
nullif there are no options
-
suppressesTemporalTablePrimaryKeys
public boolean suppressesTemporalTablePrimaryKeys(boolean partitioned) Description copied from interface:TemporalTableSupportDo we need to suppress creation of the primary key constraint on a temporal table?- Specified by:
suppressesTemporalTablePrimaryKeysin interfaceTemporalTableSupport- Parameters:
partitioned- Is partitioning requested
-
supportsTemporalTablePartitioning
public boolean supportsTemporalTablePartitioning()Description copied from interface:TemporalTableSupportDo we support partitioning temporal tables in this dialect?- Specified by:
supportsTemporalTablePartitioningin interfaceTemporalTableSupport- See Also:
-
addTemporalTableAuxiliaryObjects
public void addTemporalTableAuxiliaryObjects(TemporalTableStrategy strategy, Table table, Database database, boolean partitioned, String currentPartitionName, String historyPartitionName) Description copied from interface:TemporalTableSupportRegister any auxiliary database objects required for the given temporary table and strategy. Used to create history tables or table partitions.- Specified by:
addTemporalTableAuxiliaryObjectsin interfaceTemporalTableSupport- Parameters:
strategy- The temporal table strategytable- A temporal tabledatabase- The database to register withpartitioned- Is partitioning requestedcurrentPartitionName- The current partition name, if specifiedhistoryPartitionName- The history partition name, if specified
-
getExtraTemporalTableDeclarations
public String getExtraTemporalTableDeclarations(TemporalTableStrategy strategy, String rowStartColumn, String rowEndColumn, boolean partitioned) Description copied from interface:TemporalTableSupportAny extra declarations required as part of thecreate tablestatement for a temporal table. These declarations, unlike the options come inside the parentheses, along with the column and constraint definitions. Examples include theperiod for system_timeclause, the Db2transaction start idcolumn, the MySQL partitioning column, and so on.- Specified by:
getExtraTemporalTableDeclarationsin interfaceTemporalTableSupport- Parameters:
strategy- The temporal table strategypartitioned- Is partitioning requested
-
createTemporalTableCheckConstraint
Description copied from interface:TemporalTableSupportShould we create acheckconstraint to enforce effectivity constraints? (That starting timestamps precede ending timestamps.) This is typically not needed for native temporal tables.- Specified by:
createTemporalTableCheckConstraintin interfaceTemporalTableSupport
-
getAsOfOperator
Description copied from interface:TemporalTableSupportThe operator used to specify a temporal instant for querying historical data. Usuallyfor system_time as of. This is usually used together with native temporal tables, but in Oracle we use it all the time.- Specified by:
getAsOfOperatorin interfaceTemporalTableSupport
-
useAsOfOperator
Description copied from interface:TemporalTableSupportShould be use thefor system_time as ofoperator when querying temporal tables? We usually only use it for querying native temporal tables at a historical instant, but in Oracle we use it all the time.- Specified by:
useAsOfOperatorin interfaceTemporalTableSupport- Parameters:
strategy- The strategy
-
useTemporalRestriction
Description copied from interface:TemporalTableSupportShould we use temporal restrictions on therow startandrow endcolumns when querying temporal tables? We usually use them unless we are using native temporal tables, but on Oracle we never use them.- Specified by:
useTemporalRestrictionin interfaceTemporalTableSupport- Parameters:
influencers- TheLoadQueryInfluencers
-
getTemporalExclusionColumnOption
Description copied from interface:TemporalTableSupportColumn options for a native implementation of exclusion from temporal versioning.- Specified by:
getTemporalExclusionColumnOptionin interfaceTemporalTableSupport
-
getDefaultTemporalTableStrategy
Description copied from interface:TemporalTableSupportThe recommended temporal table strategy for this dialect.- Specified by:
getDefaultTemporalTableStrategyin interfaceTemporalTableSupport- See Also:
-