Fixed bug in node validation: We did not check if group nodes are still contained

by their parents unless they use an accessname, which is often not the case.
This commit is contained in:
hns 2002-10-30 19:23:17 +00:00
parent 3e278641a1
commit c04096e65c

View file

@ -274,18 +274,19 @@ public final class NodeManager {
if (node != null && node.getState() != Node.INVALID) { if (node != null && node.getState() != Node.INVALID) {
// check if node is null node (cached null) // check if node is null node (cached null)
if (node.isNullNode ()) { if (node.isNullNode ()) {
if (node.created() < rel.otherType.getLastDataChange () || if (node.created < rel.otherType.getLastDataChange () ||
node.created() < rel.ownType.getLastTypeChange()) node.created < rel.ownType.getLastTypeChange())
node = null; // cached null not valid anymore node = null; // cached null not valid anymore
} else if (!rel.virtual && !rel.usesPrimaryKey ()) { } else if (!rel.virtual) {
// apply different consistency checks for groupby nodes and database nodes: // apply different consistency checks for groupby nodes and database nodes:
// for group nodes, check if they're contained // for group nodes, check if they're contained
if (rel.groupby != null) { if (rel.groupby != null) {
if (home.contains (node) < 0) if (home.contains (node) < 0)
node = null; node = null;
// for database nodes, check if constraints are fulfilled // for database nodes, check if constraints are fulfilled
} else if (!rel.checkConstraints (home, node)) { } else if (!rel.usesPrimaryKey ()) {
node = null; if (!rel.checkConstraints (home, node))
node = null;
} }
} }
} }