Search in sources :

Example 1 with UniquePropsEntity

use of org.hibernate.envers.test.entities.components.UniquePropsEntity in project hibernate-orm by hibernate.

the class PropertiesGroupTest method initData.

@Test
@Priority(10)
public void initData() {
    uniquePropsAudit = metadata().getEntityBinding("org.hibernate.envers.test.entities.components.UniquePropsEntity_AUD");
    uniquePropsNotAuditedAudit = metadata().getEntityBinding("org.hibernate.envers.test.entities.components.UniquePropsNotAuditedEntity_AUD");
    // Revision 1
    Session session = openSession();
    session.getTransaction().begin();
    UniquePropsEntity ent = new UniquePropsEntity();
    ent.setData1("data1");
    ent.setData2("data2");
    session.persist(ent);
    session.getTransaction().commit();
    entityRev1 = new UniquePropsEntity(ent.getId(), ent.getData1(), ent.getData2());
    // Revision 2
    session.getTransaction().begin();
    UniquePropsNotAuditedEntity entNotAud = new UniquePropsNotAuditedEntity();
    entNotAud.setData1("data3");
    entNotAud.setData2("data4");
    session.persist(entNotAud);
    session.getTransaction().commit();
    entityNotAuditedRev2 = new UniquePropsNotAuditedEntity(entNotAud.getId(), entNotAud.getData1(), null);
}
Also used : UniquePropsNotAuditedEntity(org.hibernate.envers.test.entities.components.UniquePropsNotAuditedEntity) UniquePropsEntity(org.hibernate.envers.test.entities.components.UniquePropsEntity) Session(org.hibernate.Session) Test(org.junit.Test) Priority(org.hibernate.envers.test.Priority)

Aggregations

Session (org.hibernate.Session)1 Priority (org.hibernate.envers.test.Priority)1 UniquePropsEntity (org.hibernate.envers.test.entities.components.UniquePropsEntity)1 UniquePropsNotAuditedEntity (org.hibernate.envers.test.entities.components.UniquePropsNotAuditedEntity)1 Test (org.junit.Test)1