From bb90831541a7820ea6781935c89987a2697f6813 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 30 Jul 2001 16:07:49 +0000 Subject: [PATCH] also use xxx.filter in groupby nodes. --- src/helma/objectmodel/db/Node.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index 76405795..5e14805e 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -963,9 +963,15 @@ public class Node implements INode, Serializable { dbm.setPropertyRelation (prel.getGroupbyPropertyRelation()); } 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+"'"; if (gsrel.direction == Relation.BACKWARD) snrel += " AND "+gsrel.getRemoteField()+"='"+getNonVirtualHomeID()+"'"; + if (gsrel.filter != null) + snrel += " AND "+gsrel.filter; if (gsrel.order != null) snrel += " ORDER BY "+gsrel.order; node.setSubnodeRelation (snrel);