From fa6a2f615961092007b74d82cc1178926b38ae3b Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Wed, 25 Jan 2012 22:07:50 -0600 Subject: [PATCH] HHH-6580 - Discriminator value used as ID when inserting entity to PosgtreSQL --- ...istChildEntitiesWithDiscriminatorTest.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/inheritancediscriminator/PersistChildEntitiesWithDiscriminatorTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/inheritancediscriminator/PersistChildEntitiesWithDiscriminatorTest.java index ad432f9fe3..9e61640180 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/inheritancediscriminator/PersistChildEntitiesWithDiscriminatorTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/inheritancediscriminator/PersistChildEntitiesWithDiscriminatorTest.java @@ -41,21 +41,20 @@ public class PersistChildEntitiesWithDiscriminatorTest extends BaseCoreFunctiona } @Test - public void shouldPersistTwoEntities() { + public void doIt() { Session session = openSession(); session.beginTransaction(); - InheritingEntity child1 = new InheritingEntity(); - InheritingEntity child2 = new InheritingEntity(); - child1.setSomeValue("blabla"); - session.save(child1); + InheritingEntity child = new InheritingEntity(); + child.setSomeValue("blabla"); + session.save(child); + session.getTransaction().commit(); + session.close(); - session.flush(); - session.clear(); - InheritingEntity loaded = (InheritingEntity) session.load(InheritingEntity.class, child1.getId()); - loaded.getId(); - - session.save(child2); - session.getTransaction().rollback(); + session = openSession(); + session.beginTransaction(); + session.delete( child ); + session.getTransaction().commit(); + session.close(); } }