use of org.hibernate.test.annotations.id.sequences.entities.Home in project hibernate-orm by hibernate.
the class IdTest method testParameterizedAuto.
@Test
public void testParameterizedAuto() throws Exception {
Session s;
Transaction tx;
s = openSession();
tx = s.beginTransaction();
Home h = new Home();
s.persist(h);
tx.commit();
s.close();
assertNotNull(h.getId());
s = openSession();
tx = s.beginTransaction();
Home reloadedHome = (Home) s.get(Home.class, h.getId());
assertEquals(h.getId(), reloadedHome.getId());
s.delete(reloadedHome);
tx.commit();
s.close();
}
use of org.hibernate.test.annotations.id.sequences.entities.Home in project hibernate-orm by hibernate.
the class IdTest method testDefaultSequence.
@Test
public void testDefaultSequence() throws Exception {
Session s;
Transaction tx;
s = openSession();
tx = s.beginTransaction();
Home h = new Home();
s.persist(h);
tx.commit();
s.close();
assertNotNull(h.getId());
s = openSession();
tx = s.beginTransaction();
Home reloadedHome = (Home) s.get(Home.class, h.getId());
assertEquals(h.getId(), reloadedHome.getId());
s.delete(reloadedHome);
tx.commit();
s.close();
}
Aggregations