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

This commit is contained in:
Robin Bygrave
2015-07-24 10:18:17 +12:00
parent 3cafb37a73
commit 82489636d5
37 changed files with 601 additions and 92 deletions
@@ -1,8 +1,10 @@
package com.avaje.ebeaninternal.server.query;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.avaje.ebean.RawSql;
@@ -174,6 +176,17 @@ public class CQueryPredicates {
}
}
List<String> historyTableAlias = query.getAsOfTableAlias();
if (historyTableAlias != null) {
// bind the asAt value for each table alias
// there is one effective date predicate per table alias
Timestamp asOf = query.getAsOf();
bindLog.append(" asOf ").append(asOf);
for (int i = 0; i < historyTableAlias.size(); i++) {
binder.bindObject(dataBind, asOf);
}
}
if (havingNamedParams != null) {
// bind named parameters in having...
bindLog.append(" havingNamed ");