Search in sources :

Example 1 with NotAuditedTestEntity

use of org.hibernate.envers.test.integration.auditReader.NotAuditedTestEntity in project hibernate-orm by hibernate.

the class HasChangedAPITest method initData.

@Test
@Priority(10)
public void initData() {
    EntityManager em = getEntityManager();
    em.getTransaction().begin();
    AuditedTestEntity ent1 = new AuditedTestEntity(1, "str1");
    NotAuditedTestEntity ent2 = new NotAuditedTestEntity(1, "str1");
    em.persist(ent1);
    em.persist(ent2);
    em.getTransaction().commit();
    em.getTransaction().begin();
    ent1 = em.find(AuditedTestEntity.class, 1);
    ent2 = em.find(NotAuditedTestEntity.class, 1);
    ent1.setStr1("str2");
    ent2.setStr1("str2");
    em.getTransaction().commit();
}
Also used : EntityManager(javax.persistence.EntityManager) NotAuditedTestEntity(org.hibernate.envers.test.integration.auditReader.NotAuditedTestEntity) AuditedTestEntity(org.hibernate.envers.test.integration.auditReader.AuditedTestEntity) NotAuditedTestEntity(org.hibernate.envers.test.integration.auditReader.NotAuditedTestEntity) Test(org.junit.Test) Priority(org.hibernate.envers.test.Priority)

Aggregations

EntityManager (javax.persistence.EntityManager)1 Priority (org.hibernate.envers.test.Priority)1 AuditedTestEntity (org.hibernate.envers.test.integration.auditReader.AuditedTestEntity)1 NotAuditedTestEntity (org.hibernate.envers.test.integration.auditReader.NotAuditedTestEntity)1 Test (org.junit.Test)1