diff --git a/src/helma/objectmodel/Relation.java b/src/helma/objectmodel/Relation.java index cb4341a6..5127c01d 100644 --- a/src/helma/objectmodel/Relation.java +++ b/src/helma/objectmodel/Relation.java @@ -229,6 +229,7 @@ public class Relation { throw new RuntimeException ("getVirtualPropertyRelation called on non-virtual relation"); Relation vr = new Relation (other, localField, remoteField, direction, subnodesAreProperties); vr.groupby = groupby; + vr.filter = filter; return vr; } @@ -236,10 +237,6 @@ public class Relation { * Return a Relation that defines the subnodes of a group-by node. */ public Relation getGroupbySubnodeRelation () { - if (groupby == null) - throw new RuntimeException ("getGroupbySubnodeRelation called on non-group-by relation"); - if (filter != null) - return filter; return getGroupbyPropertyRelation (); } @@ -249,6 +246,8 @@ public class Relation { public Relation getGroupbyPropertyRelation () { if (groupby == null) throw new RuntimeException ("getGroupbyPropertyRelation called on non-group-by relation"); + if (filter != null) + return filter; return new Relation (other, localField, remoteField, direction, subnodesAreProperties); }