// same UUID, i.e. the node is still referenceable.
if (refs.hasReferences() && !local.has(node.getNodeId())) {
String msg = node.getNodeId()
+ ": the node cannot be removed because it is still being referenced.";
log.debug(msg);
throw new ReferentialIntegrityException(msg);
}
}
}
}
// check whether targets of modified node references exist
for (Iterator iter = local.modifiedRefs(); iter.hasNext();) {
NodeReferences refs = (NodeReferences) iter.next();
NodeId id = refs.getTargetId();
// no need to check existence of target if there are no references
if (refs.hasReferences()) {
// please note:
// virtual providers are indirectly checked via 'hasItemState()'
if (!local.has(id) && !hasItemState(id)) {
String msg = "Target node " + id
+ " of REFERENCE property does not exist";
log.debug(msg);
throw new ReferentialIntegrityException(msg);
}
}
}
}