@@ -0,0 +1,1354 @@
+%0A/*%0A * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.%0A */%0A%0Apackage org.jsimpledb.core;%0A%0Aimport java.io.ByteArrayInputStream;%0A%0Aimport org.jsimpledb.kv.simple.SimpleKVDatabase;%0Aimport org.jsimpledb.schema.SchemaModel;%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.Test;%0A%0Apublic class DeleteCascadeTest extends CoreAPITestSupport %7B%0A%0A    @Test%0A    public void testDeleteCascade() throws Exception %7B%0A%0A        final SimpleKVDatabase kvstore = new SimpleKVDatabase();%0A        final Database db = new Database(kvstore);%0A%0A        final String xml =%0A            %22%3C?xml version=%5C%221.0%5C%22 encoding=%5C%22UTF-8%5C%22?%3E%5Cn%22%0A          + %22%3CSchema formatVersion=%5C%221%5C%22%3E%5Cn%22%0A          + %22  %3CObjectType name=%5C%22Person%5C%22 storageId=%5C%221%5C%22%3E%5Cn%22%0A          + %22    %3CReferenceField storageId=%5C%222%5C%22 name=%5C%22Person%5C%22 cascadeDelete=%5C%22true%5C%22 onDelete=%5C%22EXCEPTION%5C%22/%3E%5Cn%22%0A          + %22  %3C/ObjectType%3E%5Cn%22%0A          + %22%3C/Schema%3E%5Cn%22;%0A        final SchemaModel schema = SchemaModel.fromXML(new ByteArrayInputStream(xml.getBytes(%22UTF-8%22)));%0A%0A        final Transaction tx = db.createTransaction(schema, 1, true);%0A%0A        final ObjId id1 = tx.create(1);%0A        final ObjId id2 = tx.create(1);%0A%0A        tx.writeSimpleField(id1, 2, id2, false);%0A%0A        tx.delete(id1);%0A%0A        Assert.assertFalse(tx.exists(id1));%0A        Assert.assertFalse(tx.exists(id2));%0A%0A        tx.commit();%0A    %7D%0A%7D%0A%0A

Add simple unit test for delete cascade.