#782 - History Many-To-Many Lazy-Loads fail

This commit is contained in:
Robin Bygrave committed 2016-07-25 23:31:02 +12:00
1 parent b763f4c875
commit 6108ef484b
6 files changed
+47 -2

No files matched your search

@@ -472,8 +472,7 @@ public class CQueryBuilder {
hasWhere = true;
}
int asOfCount = query.getAsOfTableCount();
if (asOfCount > 0 && !historySupport.isStandardsBased()) {
if (query.isAsOfBaseTable() && !historySupport.isStandardsBased()) {
hasWhere = appendWhere(hasWhere, sb);
sb.append(historySupport.getAsOfPredicate(request.getBaseTableAlias()));
}
@@ -507,6 +507,9 @@ public class SqlTreeNodeBean implements SqlTreeNode {
if (desc.isHistorySupport()) {
query.incrementAsOfTableCount();
}
if (lazyLoadParent != null && lazyLoadParent.isManyToManyWithHistory()) {
query.incrementAsOfTableCount();
}
if (intersectionAsOfTableAlias) {
query.incrementAsOfTableCount();
}
@@ -33,6 +33,22 @@ public final class SqlTreeNodeRoot extends SqlTreeNodeBean {
this.includeJoin = null;
}
/**
* Set AsOf support (at root level).
*/
public void addAsOfTableAlias(SpiQuery<?> query) {
if (desc.isHistorySupport()) {
query.setAsOfBaseTable();
query.incrementAsOfTableCount();
}
if (lazyLoadParent != null && lazyLoadParent.isManyToManyWithHistory()) {
query.incrementAsOfTableCount();
}
for (int i = 0; i < children.length; i++) {
children[i].addAsOfTableAlias(query);
}
}
/**
* For the root node there is no join type or on clause etc.
*/