// same UUID, i.e. the node is still referenceable.
if (refs.hasReferences() && !changes.has(node.getId())) {
String msg = node.getId()
+ ": 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 = changes.modifiedRefs(); iter.hasNext();) {
NodeReferences refs = (NodeReferences) iter.next();
NodeId id = new NodeId(refs.getUUID());
// 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 (!changes.has(id) && !hasItemState(id)) {
String msg = "Target node " + id
+ " of REFERENCE property does not exist";
log.debug(msg);
throw new ReferentialIntegrityException(msg);
}
}
}
}