Only call Relation.checkConstraints() in isParentOf() if the subnode relation does

not have a filter set, because checkConstraints() always returns false in that case.
This commit is contained in:
hns 2004-02-27 14:45:49 +00:00
parent 38c9d74be6
commit 08c443ce6a

View file

@ -1357,10 +1357,13 @@ public final class Node implements INode, Serializable {
if (dbmap != null) { if (dbmap != null) {
Relation subrel = dbmap.getSubnodeRelation(); Relation subrel = dbmap.getSubnodeRelation();
// if we're dealing with relational child nodes use // if we're dealing with relational child nodes use
// Relation.checkConstraints to avoid loading the child index // Relation.checkConstraints to avoid loading the child index.
if (subrel != null && // Note that we only do that if no filter is set, since
subrel.otherType != null && // Relation.checkConstraints() would always return false
subrel.otherType.isRelational()) { // if there was a filter property.
if (subrel != null && subrel.otherType != null
&& subrel.otherType.isRelational()
&& subrel.filter == null) {
return subrel.checkConstraints(this, n); return subrel.checkConstraints(this, n);
} }
} }