Package io.ebean.config.dbplatform
Interface DbHistorySupport
-
- All Known Implementing Classes:
DbStandardHistorySupport
,DbViewHistorySupport
,H2HistorySupport
,HanaHistorySupport
,MariaDbHistorySupport
,MySqlHistorySupport
,NuoDbHistorySupport
,OracleDbHistorySupport
,PostgresHistorySupport
,SqlServerHistorySupport
public interface DbHistorySupport
History support for the database platform.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getAsOfPredicate(String tableAlias, String sysPeriod)
Return the 'as of' predicate added for the given table alias.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.int
getBindCount()
Return the number of columns bound in a 'As Of' predicate.String
getSysPeriodLower(String tableAlias, String sysPeriod)
Return the column for the system period lower bound that will be included in findVersions() queries.String
getSysPeriodUpper(String tableAlias, String sysPeriod)
Return the column for the system period upper bound that will be included in findVersions() queries.String
getVersionsBetweenSuffix(String asOfViewSuffix)
Return the 'versions between timestamp' suffix.boolean
isStandardsBased()
Return true if the implementation is SQL2011 standards based.
-
-
-
Method Detail
-
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 forsysPeriod
- 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
-
-