#347 - @History support with query.asOf(Timestamp)

This commit is contained in:
Robin Bygrave committed 2015-07-24 10:18:17 +12:00
1 parent 3cafb37a73
commit 82489636d5
37 files changed
+601 -92

No files matched your search

@@ -87,6 +87,11 @@ public class DeployBeanDescriptor<T> {
* The base database table.
*/
private String baseTable;
private String baseTableAsOf;
private boolean historySupport;
private TableName baseTableFull;
private String[] properties;
@@ -135,6 +140,20 @@ public class DeployBeanDescriptor<T> {
return Modifier.isAbstract(beanType.getModifiers());
}
/**
* Set to true for @History entity beans that have history.
*/
public void setHistorySupport(boolean historySupport) {
this.historySupport = historySupport;
}
/**
* Return true if this is an @History entity bean.
*/
public boolean isHistorySupport() {
return historySupport;
}
public boolean isScalaObject() {
Class<?>[] interfaces = beanType.getInterfaces();
for (int i = 0; i < interfaces.length; i++) {
@@ -405,6 +424,10 @@ public class DeployBeanDescriptor<T> {
return baseTable;
}
public String getBaseTableAsOf() {
return baseTableAsOf;
}
/**
* Return the base table with full structure.
*/
@@ -413,12 +436,12 @@ public class DeployBeanDescriptor<T> {
}
/**
* Set the base table. Only properties mapped to the base table are by default
* persisted.
* Set the base table. Only properties mapped to the base table are by default persisted.
*/
public void setBaseTable(TableName baseTableFull) {
public void setBaseTable(TableName baseTableFull, String asOfSuffix) {
this.baseTableFull = baseTableFull;
this.baseTable = baseTableFull == null ? null : baseTableFull.getQualifiedName();
this.baseTableAsOf = baseTable + asOfSuffix;
}
public void sortProperties() {
@@ -215,6 +215,8 @@ public class DeployBeanProperty {
private boolean indexed;
private String indexName;
private boolean excludedFromHistory;
public DeployBeanProperty(DeployBeanDescriptor<?> desc, Class<?> propertyType, ScalarType<?> scalarType, ScalarTypeConverter<?, ?> typeConverter) {
this.desc = desc;
this.propertyType = propertyType;
@@ -912,4 +914,12 @@ public class DeployBeanProperty {
public void setIndexName(String indexName) {
this.indexName = indexName;
}
public boolean isExcludedFromHistory() {
return excludedFromHistory;
}
public void setExcludedFromHistory(boolean excludedFromHistory) {
this.excludedFromHistory = excludedFromHistory;
}
}