HHH-6580 - Discriminator value used as ID when inserting entity to PosgtreSQL

This commit is contained in:
Steve Ebersole 2012-01-25 22:07:50 -06:00
parent 917eef5ad1
commit fa6a2f6159
1 changed files with 11 additions and 12 deletions

View File

@ -41,21 +41,20 @@ public class PersistChildEntitiesWithDiscriminatorTest extends BaseCoreFunctiona
} }
@Test @Test
public void shouldPersistTwoEntities() { public void doIt() {
Session session = openSession(); Session session = openSession();
session.beginTransaction(); session.beginTransaction();
InheritingEntity child1 = new InheritingEntity(); InheritingEntity child = new InheritingEntity();
InheritingEntity child2 = new InheritingEntity(); child.setSomeValue("blabla");
child1.setSomeValue("blabla"); session.save(child);
session.save(child1); session.getTransaction().commit();
session.close();
session.flush(); session = openSession();
session.clear(); session.beginTransaction();
InheritingEntity loaded = (InheritingEntity) session.load(InheritingEntity.class, child1.getId()); session.delete( child );
loaded.getId(); session.getTransaction().commit();
session.close();
session.save(child2);
session.getTransaction().rollback();
} }
} }