also use xxx.filter in groupby nodes.

This commit is contained in:
hns 2001-07-30 16:07:49 +00:00
parent 6b8424f61e
commit bb90831541

View file

@ -963,9 +963,15 @@ public class Node implements INode, Serializable {
dbm.setPropertyRelation (prel.getGroupbyPropertyRelation()); dbm.setPropertyRelation (prel.getGroupbyPropertyRelation());
} }
node.setDbMapping (dbm); node.setDbMapping (dbm);
// one day, Relation should be smart enough to generate the subnode clause
// on the fly. Until then, we prepare it statically for each groupby node.
// This has the drawback that updates in the type definition won't affect already created
// groupby objects.
String snrel = "WHERE "+srel.groupby +"='"+sid+"'"; String snrel = "WHERE "+srel.groupby +"='"+sid+"'";
if (gsrel.direction == Relation.BACKWARD) if (gsrel.direction == Relation.BACKWARD)
snrel += " AND "+gsrel.getRemoteField()+"='"+getNonVirtualHomeID()+"'"; snrel += " AND "+gsrel.getRemoteField()+"='"+getNonVirtualHomeID()+"'";
if (gsrel.filter != null)
snrel += " AND "+gsrel.filter;
if (gsrel.order != null) if (gsrel.order != null)
snrel += " ORDER BY "+gsrel.order; snrel += " ORDER BY "+gsrel.order;
node.setSubnodeRelation (snrel); node.setSubnodeRelation (snrel);