assertNull(rootData[2]);
}
public void testInsert_Sub1() throws Exception {
TableHelper ivRootTable = new TableHelper(dbHelper, "IV_ROOT");
ivRootTable.setColumns("ID", "NAME", "DISCRIMINATOR");
TableHelper ivSub1Table = new TableHelper(dbHelper, "IV_SUB1");
ivSub1Table.setColumns("ID", "SUB1_NAME");
IvSub1 sub1 = context.newObject(IvSub1.class);
sub1.setName("XyZX");
sub1.getObjectContext().commitChanges();
assertEquals(1, ivRootTable.getRowCount());
assertEquals(1, ivSub1Table.getRowCount());
Object[] data = ivRootTable.select();
assertEquals(3, data.length);
assertTrue(data[0] instanceof Number);
assertTrue(((Number) data[0]).intValue() > 0);
assertEquals("XyZX", data[1]);
assertEquals("IvSub1", data[2]);
Object[] subdata = ivSub1Table.select();
assertEquals(2, subdata.length);
assertEquals(data[0], subdata[0]);
assertNull(subdata[1]);
ivSub1Table.deleteAll();
ivRootTable.deleteAll();
IvSub1 sub11 = context.newObject(IvSub1.class);
sub11.setName("XyZXY");
sub11.setSub1Name("BdE2");
sub11.getObjectContext().commitChanges();
data = ivRootTable.select();
assertEquals(3, data.length);
assertTrue(data[0] instanceof Number);
assertTrue(((Number) data[0]).intValue() > 0);
assertEquals("XyZXY", data[1]);
assertEquals("IvSub1", data[2]);
subdata = ivSub1Table.select();
assertEquals(2, subdata.length);
assertEquals(data[0], subdata[0]);
assertEquals("BdE2", subdata[1]);
}