Search in sources :

Example 1 with FirTree

use of org.hibernate.test.annotations.id.sequences.entities.FirTree in project hibernate-orm by hibernate.

the class IdTest method testIdInEmbeddableSuperclass.

@Test
public void testIdInEmbeddableSuperclass() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    FirTree chrismasTree = new FirTree();
    s.persist(chrismasTree);
    tx.commit();
    s.clear();
    tx = s.beginTransaction();
    chrismasTree = (FirTree) s.get(FirTree.class, chrismasTree.getId());
    assertNotNull(chrismasTree);
    s.delete(chrismasTree);
    tx.commit();
    s.close();
}
Also used : FirTree(org.hibernate.test.annotations.id.sequences.entities.FirTree) Transaction(org.hibernate.Transaction) Session(org.hibernate.Session) Test(org.junit.Test)

Aggregations

Session (org.hibernate.Session)1 Transaction (org.hibernate.Transaction)1 FirTree (org.hibernate.test.annotations.id.sequences.entities.FirTree)1 Test (org.junit.Test)1