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
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();
}
}