made contains() work with groupby nodes

containting relational objects
This commit is contained in:
hns 2001-02-09 15:27:10 +00:00
parent 037ecba368
commit 1bdff708b2

View file

@ -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 ());
}
/**