TpcInheritB2 instB2 = new TpcInheritB2();
instB2.setId(3);
instB2.setInhB2(Arrays.asList("one", "two", "three"));
session.insert(instB2);
TpcInheritC instC = new TpcInheritC();
instC.setId(4);
instC.setInhC(new HashMap<String, String>());
instC.getInhC().put("one", "1");
instC.getInhC().put("two", "2");
instC.getInhC().put("three", "3");
session.insert(instC);
TpcInheritA loadedA = (TpcInheritA) session.loadOne(TpcBaseEntity.class, 1);
Assert.assertTrue(loadedA.getInhA() instanceof LazyList);
Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));
loadedA = session.loadOne(TpcInheritA.class, 1);
Assert.assertTrue(loadedA.getInhA() instanceof LazyList);
Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));
TpcInheritB loadedB = (TpcInheritB) session.loadOne(TpcBaseEntity.class, 2);
Assert.assertTrue(loadedB.getInhB() instanceof LazySet);
Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));
loadedB = session.loadOne(TpcInheritB.class, 2);
Assert.assertTrue(loadedB.getInhB() instanceof LazySet);
Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));
TpcInheritB2 loadedB2 = (TpcInheritB2) session.loadOne(TpcBaseEntity.class, 3);
Assert.assertTrue(loadedB2.getInhB2() instanceof LazyList);
Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));
loadedB2 = session.loadOne(TpcInheritB2.class, 3);
Assert.assertTrue(loadedB2.getInhB2() instanceof LazyList);
Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));
TpcInheritC loadedC = (TpcInheritC) session.loadOne(TpcBaseEntity.class, 4);
Assert.assertTrue(loadedC.getInhC() instanceof LazyMap);
Assert.assertEquals(loadedC.getInhC().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
loadedC = session.loadOne(TpcInheritC.class, 4);
Assert.assertTrue(loadedC.getInhC() instanceof LazyMap);
Assert.assertEquals(loadedC.getInhC().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
}finally {session.close();}
}