*/
public void test07CascadeDeleteConditional() {
try {
AbstractRelationship rel = cascadeRel(TestOne.class, TestTwo.class, Relation.CONSTRAINT_BASED);
NodeInterface sourceNode;
String startNodeId;
String endNodeId;
try (final Tx tx = app.tx()) {
startNodeId = rel.getSourceNode().getUuid();
endNodeId = rel.getTargetNode().getUuid();
sourceNode = rel.getSourceNode();
}
deleteCascade(sourceNode);
try (final Tx tx = app.tx()) {
// Start node should be deleted
assertNodeNotFound(startNodeId);
// End node should be deleted
assertNodeNotFound(endNodeId);
}
rel = cascadeRel(TestOne.class, TestThree.class, Relation.CONSTRAINT_BASED);
try (final Tx tx = app.tx()) {
startNodeId = rel.getSourceNode().getUuid();
endNodeId = rel.getTargetNode().getUuid();
sourceNode = rel.getSourceNode();
}
deleteCascade(sourceNode);
try (final Tx tx = app.tx()) {
// Start node should be deleted
assertNodeNotFound(startNodeId);
// End node should still be there
assertNodeExists(endNodeId);
}
rel = cascadeRel(TestOne.class, TestFour.class, Relation.CONSTRAINT_BASED);
try (final Tx tx = app.tx()) {
startNodeId = rel.getSourceNode().getUuid();
endNodeId = rel.getTargetNode().getUuid();
sourceNode = rel.getSourceNode();
}
deleteCascade(sourceNode);
try (final Tx tx = app.tx()) {