toMany.setDescription("werew");
toMany.setNum(78);
toMany.setNumBalls(33);
mgr.put(toMany);
InheritanceToMany rel = new InheritanceToMany();
rel.addEntity(common);
rel.addEntity(toMany);
mgr.put(rel);
mgr.flush();
InheritanceToMany newRel = mgr.find(InheritanceToMany.class, rel.getId());
InheritanceSuper sub1 = newRel.getNameToEntity().get(common.getLastName());
Assert.assertEquals(common.getId(), sub1.getId());
Assert.assertEquals(common.getName(), ((InheritanceSub1)sub1).getName());
Assert.assertEquals(common.getNum(), sub1.getNum());
InheritanceSuper sub2 = newRel.getNameToEntity().get(toMany.getLastName());
Assert.assertEquals(toMany.getId(), sub2.getId());
Assert.assertEquals(toMany.getNum(), sub2.getNum());
Assert.assertEquals(toMany.getDescription(), ((InheritanceSub2)sub2).getDescription());
}