From 1bdff708b243e35a38df8a52e98459f9bf17a55f Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 9 Feb 2001 15:27:10 +0000 Subject: [PATCH] made contains() work with groupby nodes containting relational objects --- src/helma/objectmodel/db/Node.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index 4506685c..8a34fb55 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -1037,7 +1037,15 @@ public class Node implements INode, Serializable { loadNodes (); if (subnodes == null) return -1; - return subnodes.indexOf (n.getID ()); + // if the node contains relational groupby subnodes, the subnodes vector contains the names instead of ids. + Relation srel = dbmap == null ? null : dbmap.getSubnodeRelation (); + if (srel != null && srel.groupby != null && srel.other != null && srel.other.isRelational ()) { + if (n.getParent () != this) + return -1; + else + return subnodes.indexOf (n.getName ()); + } else + return subnodes.indexOf (n.getID ()); } /**