Search in sources :

Example 1 with ChildEntity

use of org.hibernate.envers.test.integration.inheritance.joined.ChildEntity in project hibernate-orm by hibernate.

the class HasChangedChildAuditing method initData.

@Test
@Priority(10)
public void initData() {
    EntityManager em = getEntityManager();
    id1 = 1;
    // Rev 1
    em.getTransaction().begin();
    ChildEntity ce = new ChildEntity(id1, "x", 1l);
    em.persist(ce);
    em.getTransaction().commit();
    // Rev 2
    em.getTransaction().begin();
    ce = em.find(ChildEntity.class, id1);
    ce.setData("y");
    ce.setNumVal(2l);
    em.getTransaction().commit();
}
Also used : EntityManager(javax.persistence.EntityManager) ChildEntity(org.hibernate.envers.test.integration.inheritance.joined.ChildEntity) Test(org.junit.Test) Priority(org.hibernate.envers.test.Priority)

Aggregations

EntityManager (javax.persistence.EntityManager)1 Priority (org.hibernate.envers.test.Priority)1 ChildEntity (org.hibernate.envers.test.integration.inheritance.joined.ChildEntity)1 Test (org.junit.Test)1