Search in sources :

Example 1 with ManyToOneIdNotAuditedTestEntity

use of org.hibernate.envers.test.entities.ids.ManyToOneIdNotAuditedTestEntity in project hibernate-orm by hibernate.

the class ManyToOneIdNotAudited method initData.

@Test
@Priority(10)
public void initData() {
    // Revision 1
    EntityManager em = getEntityManager();
    em.getTransaction().begin();
    UnversionedStrTestEntity uste = new UnversionedStrTestEntity();
    uste.setStr("test1");
    em.persist(uste);
    id1 = new ManyToOneNotAuditedEmbId(uste);
    em.getTransaction().commit();
    // Revision 2
    em = getEntityManager();
    em.getTransaction().begin();
    ManyToOneIdNotAuditedTestEntity mtoinate = new ManyToOneIdNotAuditedTestEntity();
    mtoinate.setData("data1");
    mtoinate.setId(id1);
    em.persist(mtoinate);
    em.getTransaction().commit();
}
Also used : EntityManager(javax.persistence.EntityManager) ManyToOneIdNotAuditedTestEntity(org.hibernate.envers.test.entities.ids.ManyToOneIdNotAuditedTestEntity) ManyToOneNotAuditedEmbId(org.hibernate.envers.test.entities.ids.ManyToOneNotAuditedEmbId) UnversionedStrTestEntity(org.hibernate.envers.test.entities.UnversionedStrTestEntity) Test(org.junit.Test) Priority(org.hibernate.envers.test.Priority)

Aggregations

EntityManager (javax.persistence.EntityManager)1 Priority (org.hibernate.envers.test.Priority)1 UnversionedStrTestEntity (org.hibernate.envers.test.entities.UnversionedStrTestEntity)1 ManyToOneIdNotAuditedTestEntity (org.hibernate.envers.test.entities.ids.ManyToOneIdNotAuditedTestEntity)1 ManyToOneNotAuditedEmbId (org.hibernate.envers.test.entities.ids.ManyToOneNotAuditedEmbId)1 Test (org.junit.Test)1