HHH-6580 - Discriminator value used as ID when inserting entity to PosgtreSQL
This commit is contained in:
parent
917eef5ad1
commit
fa6a2f6159
|
@ -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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue