Module io.ebean.api

Interface DbHistorySupport

All Known Implementing Classes:
DbStandardHistorySupport, DbViewHistorySupport

public interface DbHistorySupport
History support for the database platform.
  • Method Summary

    Modifier and Type
    Method
    Description
    getAsOfPredicate(String tableAlias, String sysPeriod)
    Return the 'as of' predicate added for the given table alias.
    getAsOfViewSuffix(String asOfViewSuffix)
    For sql2011 style this ignores the passed in view suffix and returns something like the ' as of timestamp ?' clause to be appended after the base table name.
    int
    Return the number of columns bound in a 'As Of' predicate.
    getSysPeriodLower(String tableAlias, String sysPeriod)
    Return the column for the system period lower bound that will be included in findVersions() queries.
    getSysPeriodUpper(String tableAlias, String sysPeriod)
    Return the column for the system period upper bound that will be included in findVersions() queries.
    Return the 'versions between timestamp' suffix.
    boolean
    Return true if the implementation is SQL2011 standards based.
  • Method Details

    • isStandardsBased

      boolean isStandardsBased()
      Return true if the implementation is SQL2011 standards based.

      Non standards based means we need to add additional predicates into the JOIN ON clause and add an additional predicate for the base table.

    • getBindCount

      int getBindCount()
      Return the number of columns bound in a 'As Of' predicate.

      This is 1 for more standard sql2011 style and Postgres which has the special range type and 2 for view based solutions with 2 columns such as MySql.

    • getAsOfViewSuffix

      String getAsOfViewSuffix(String asOfViewSuffix)
      For sql2011 style this ignores the passed in view suffix and returns something like the ' as of timestamp ?' clause to be appended after the base table name.
      Parameters:
      asOfViewSuffix - the configured view suffix (typically "_with_history").
      Returns:
      The suffix appended after the base table name in the from and join clauses.
    • getVersionsBetweenSuffix

      String getVersionsBetweenSuffix(String asOfViewSuffix)
      Return the 'versions between timestamp' suffix.
    • getAsOfPredicate

      String getAsOfPredicate(String tableAlias, String sysPeriod)
      Return the 'as of' predicate added for the given table alias.
      Parameters:
      tableAlias - The table alias this predicate is added for
      sysPeriod - The name of the 'sys_period' column used for effective date time range.
      Returns:
      The predicate containing a single ? bind parameter which will be bound to the 'as at' timestamp value
    • getSysPeriodLower

      String getSysPeriodLower(String tableAlias, String sysPeriod)
      Return the column for the system period lower bound that will be included in findVersions() queries.
      Parameters:
      tableAlias - the table alias which will typically be 't0'
      sysPeriod - the name of the sys_period column
    • getSysPeriodUpper

      String getSysPeriodUpper(String tableAlias, String sysPeriod)
      Return the column for the system period upper bound that will be included in findVersions() queries.
      Parameters:
      tableAlias - the table alias which will typically be 't0'
      sysPeriod - the name of the sys_period column