io.ebeaninternal.server.query.CQueryHistorySupport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.server.query;
import io.ebean.config.dbplatform.DbHistorySupport;
import java.util.Map;
/**
* Helper to support history functions.
*/
class CQueryHistorySupport {
/**
* The DB specific support.
*/
private final DbHistorySupport dbHistorySupport;
/**
* The mapping of base tables to their matching 'with history' views.
*/
private final Map asOfTableMap;
/**
* The sys period column.
*/
private final String sysPeriod;
CQueryHistorySupport(DbHistorySupport dbHistorySupport, Map asOfTableMap, String sysPeriod) {
this.dbHistorySupport = dbHistorySupport;
this.asOfTableMap = asOfTableMap;
this.sysPeriod = sysPeriod;
}
/**
* Return true if the underlying history support is standards based.
*/
boolean isStandardsBased() {
return dbHistorySupport.isStandardsBased();
}
/**
* Return the 'as of' history view for the given base table.
*/
String getAsOfView(String table) {
return asOfTableMap.get(table);
}
/**
* Return the lower bound column.
*/
String getSysPeriodLower(String tableAlias) {
return dbHistorySupport.getSysPeriodLower(tableAlias, sysPeriod);
}
/**
* Return the upper bound column.
*/
String getSysPeriodUpper(String tableAlias) {
return dbHistorySupport.getSysPeriodUpper(tableAlias, sysPeriod);
}
/**
* Return the predicate appended to the end of the query.
*
* Note used for Oracle total recall etc with the more standard approach.
*/
String getAsOfPredicate(String tableAlias) {
return dbHistorySupport.getAsOfPredicate(tableAlias, sysPeriod);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy