Interface TemporalTableSupport

All Known Implementing Classes:
DB2TemporalTableSupport, DefaultTemporalTableSupport, MariaDBTemporalTableSupport, MySQLTemporalTableSupport, OracleTemporalTableSupport, PostgreSQLTemporalTableSupport, SQLServerTemporalTableSupport

@Incubating public interface TemporalTableSupport
Abstracts the support for temporal tables.
Since:
7.4
  • Method Details

    • supportsNativeTemporalTables

      boolean supportsNativeTemporalTables()
      Does this dialect natively support SQL 2011-style temporal tables?
      See Also:
    • getTemporalColumnType

      int getTemporalColumnType()
      The column type to use for effectivity columns of temporal tables. The default implementation returns TIMESTAMP.
    • getTemporalColumnPrecision

      int getTemporalColumnPrecision()
      The 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.
      See Also:
    • getTemporalTableOptions

      String 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.
      Parameters:
      strategy - The temporal table strategy
      rowEndColumnName - The name of the row end column specified via Temporal.rowEnd()
      partitioned - Is partitioning requested
      currentPartitionName - The current partition name, if specified
      historyPartitionName - The history partition name, if specified
      Returns:
      The options, or null if there are no options
    • suppressesTemporalTablePrimaryKeys

      boolean suppressesTemporalTablePrimaryKeys(boolean partitioned)
      Do we need to suppress creation of the primary key constraint on a temporal table?
      Parameters:
      partitioned - Is partitioning requested
    • supportsTemporalTablePartitioning

      boolean supportsTemporalTablePartitioning()
      Do we support partitioning temporal tables in this dialect?
      See Also:
    • addTemporalTableAuxiliaryObjects

      void addTemporalTableAuxiliaryObjects(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. Used to create history tables or table partitions.
      Parameters:
      strategy - The temporal table strategy
      table - A temporal table
      database - The database to register with
      partitioned - Is partitioning requested
      currentPartitionName - The current partition name, if specified
      historyPartitionName - The history partition name, if specified
    • getExtraTemporalTableDeclarations

      String getExtraTemporalTableDeclarations(TemporalTableStrategy strategy, String rowStartColumn, String rowEndColumn, boolean partitioned)
      Any extra declarations required as part of the create table statement for a temporal table. These declarations, unlike the options come inside the parentheses, along with the column and constraint definitions. Examples include the period for system_time clause, the Db2 transaction start id column, the MySQL partitioning column, and so on.
      Parameters:
      strategy - The temporal table strategy
      partitioned - Is partitioning requested
    • createTemporalTableCheckConstraint

      boolean createTemporalTableCheckConstraint(TemporalTableStrategy strategy)
      Should we create a check constraint to enforce effectivity constraints? (That starting timestamps precede ending timestamps.) This is typically not needed for native temporal tables.
    • getAsOfOperator

      String getAsOfOperator(TemporalTableStrategy strategy)
      The operator used to specify a temporal instant for querying historical data. Usually for system_time as of. This is usually used together with native temporal tables, but in Oracle we use it all the time.
    • useAsOfOperator

      boolean useAsOfOperator(TemporalTableStrategy strategy)
      Should be use the for system_time as of operator 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.
      Parameters:
      strategy - The strategy
    • useTemporalRestriction

      boolean useTemporalRestriction(LoadQueryInfluencers influencers)
      Should we use temporal restrictions on the row start and row end columns when querying temporal tables? We usually use them unless we are using native temporal tables, but on Oracle we never use them.
      Parameters:
      influencers - The LoadQueryInfluencers
    • getTemporalExclusionColumnOption

      String getTemporalExclusionColumnOption()
      Column options for a native implementation of exclusion from temporal versioning.
    • getDefaultTemporalTableStrategy

      TemporalTableStrategy getDefaultTemporalTableStrategy()
      The recommended temporal table strategy for this dialect.
      See Also: