From b31871fdfbe0de3897e6360fac78200b21dcd296 Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 12 Mar 2004 13:20:59 +0000 Subject: [PATCH] Do a isStrorageCompatible() rather than isRelational() to handle checks for non-relational child nodes in isParentOf(). http://helma.org/bugs/show_bug.cgi?id=339#c17 --- src/helma/objectmodel/db/Node.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index 86886bf9..d2bde1ef 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -1358,7 +1358,7 @@ public final class Node implements INode, Serializable { * @return true if the given node is contained in this node's child list */ public boolean isParentOf(Node n) { - if (dbmap != null && n.isRelational()) { + if (dbmap != null) { Relation subrel = dbmap.getSubnodeRelation(); // if we're dealing with relational child nodes use // Relation.checkConstraints to avoid loading the child index. @@ -1368,6 +1368,11 @@ public final class Node implements INode, Serializable { if (subrel != null && subrel.otherType != null && subrel.otherType.isRelational() && subrel.filter == null) { + // first check if types are stored in same table + if (!subrel.otherType.isStorageCompatible(n.getDbMapping())) { + return false; + } + // if they are, check if constraints are met return subrel.checkConstraints(this, n); } }