}
@Test(dependsOnMethods = "testCollectionsRemove")
public void testCascadeDeleteSimpleObject() {
JavaCascadeDeleteTestClass test = database.newInstance(JavaCascadeDeleteTestClass.class);
JavaSimpleTestClass simple = database.newInstance(JavaSimpleTestClass.class);
simple.setText("asdasd");
test.setSimpleClass(simple);
database.save(test);
ORID testRid = database.getRecordByUserObject(test, false).getIdentity();
ORID simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
database.close();
database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
database.delete(testRid);
simple = database.load(simpleRid);
Assert.assertNull(simple);
// TEST SET NULL
database.close();
database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
test = database.newInstance(JavaCascadeDeleteTestClass.class);
simple = database.newInstance(JavaSimpleTestClass.class);
simple.setText("asdasd");
test.setSimpleClass(simple);
database.save(test);
testRid = database.getRecordByUserObject(test, false).getIdentity();
simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
database.close();
database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
test.setSimpleClass(null);
database.save(test);
simple = database.load(simpleRid);
Assert.assertNull(simple);
database.delete(test);
// TEST CHANGE NEW RECORD
test = database.newInstance(JavaCascadeDeleteTestClass.class);
simple = database.newInstance(JavaSimpleTestClass.class);
simple.setText("asdasd");
test.setSimpleClass(simple);
database.save(test);
testRid = database.getRecordByUserObject(test, false).getIdentity();
simpleRid = database.getRecordByUserObject(simple, false).getIdentity();
database.close();