java.lang.Object
io.ebean.config.dbplatform.DbViewHistorySupport
- All Implemented Interfaces:
DbHistorySupport
Database view based implementation of DbHistorySupport.
These implementations have explicit history tables, a view to union the base table and history table and triggers to maintain the history.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAsOfPredicate
(String asOfTableAlias, String asOfSysPeriod) Return the 'as of' predicate clause appended to the end of the normal query predicates.getAsOfViewSuffix
(String asOfViewSuffix) Returns the configured view suffix.int
Return 2 if we have effective start and effective end as 2 columns.getSysPeriodLower
(String tableAlias, String sysPeriod) Return the lower bound column prepended with the table alias.getSysPeriodUpper
(String tableAlias, String sysPeriod) Return the upper bound column prepended with the table alias.getVersionsBetweenSuffix
(String asOfViewSuffix) Returns the configured view suffix (same as getAsOfViewSuffix()).boolean
Return true if the implementation is SQL2011 standards based.
-
Constructor Details
-
DbViewHistorySupport
public DbViewHistorySupport()
-
-
Method Details
-
isStandardsBased
public boolean isStandardsBased()Description copied from interface:DbHistorySupport
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.
- Specified by:
isStandardsBased
in interfaceDbHistorySupport
-
getAsOfViewSuffix
Returns the configured view suffix.- Specified by:
getAsOfViewSuffix
in interfaceDbHistorySupport
- 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
Returns the configured view suffix (same as getAsOfViewSuffix()).- Specified by:
getVersionsBetweenSuffix
in interfaceDbHistorySupport
- Parameters:
asOfViewSuffix
- the configured view suffix (typically "_with_history").
-
getBindCount
public int getBindCount()Return 2 if we have effective start and effective end as 2 columns. Note that for postgres we can use a single range type so that returns 1.- Specified by:
getBindCount
in interfaceDbHistorySupport
-
getAsOfPredicate
Return the 'as of' predicate clause appended to the end of the normal query predicates.- Specified by:
getAsOfPredicate
in interfaceDbHistorySupport
- Parameters:
asOfTableAlias
- The table alias this predicate is added forasOfSysPeriod
- 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
Return the lower bound column prepended with the table alias.- Specified by:
getSysPeriodLower
in interfaceDbHistorySupport
- Parameters:
tableAlias
- the table aliassysPeriod
- the name of the sys_period column
-
getSysPeriodUpper
Return the upper bound column prepended with the table alias.- Specified by:
getSysPeriodUpper
in interfaceDbHistorySupport
- Parameters:
tableAlias
- the table aliassysPeriod
- the name of the sys_period column
-