Search in sources :

Example 1 with BidirectionalEagerHbmRefIngPK

use of org.hibernate.envers.test.entities.onetoone.BidirectionalEagerHbmRefIngPK in project hibernate-orm by hibernate.

the class BidirectionalEagerHbmTest method initData.

@Test
@Priority(10)
public void initData() {
    EntityManager em = getEntityManager();
    // Revision 1
    em.getTransaction().begin();
    BidirectionalEagerHbmRefEdPK ed1 = new BidirectionalEagerHbmRefEdPK("data_ed_1");
    BidirectionalEagerHbmRefIngPK ing1 = new BidirectionalEagerHbmRefIngPK("data_ing_1");
    ing1.setReference(ed1);
    em.persist(ed1);
    em.persist(ing1);
    em.getTransaction().commit();
    refIngId1 = ing1.getId();
    em.close();
}
Also used : EntityManager(javax.persistence.EntityManager) BidirectionalEagerHbmRefEdPK(org.hibernate.envers.test.entities.onetoone.BidirectionalEagerHbmRefEdPK) BidirectionalEagerHbmRefIngPK(org.hibernate.envers.test.entities.onetoone.BidirectionalEagerHbmRefIngPK) Test(org.junit.Test) Priority(org.hibernate.envers.test.Priority)

Example 2 with BidirectionalEagerHbmRefIngPK

use of org.hibernate.envers.test.entities.onetoone.BidirectionalEagerHbmRefIngPK in project hibernate-orm by hibernate.

the class BidirectionalEagerHbmTest method testNonProxyObjectTraversing.

@Test
public void testNonProxyObjectTraversing() {
    BidirectionalEagerHbmRefIngPK referencing = getAuditReader().find(BidirectionalEagerHbmRefIngPK.class, refIngId1, 1);
    assertNotNull(referencing.getReference().getData());
}
Also used : BidirectionalEagerHbmRefIngPK(org.hibernate.envers.test.entities.onetoone.BidirectionalEagerHbmRefIngPK) Test(org.junit.Test)

Aggregations

BidirectionalEagerHbmRefIngPK (org.hibernate.envers.test.entities.onetoone.BidirectionalEagerHbmRefIngPK)2 Test (org.junit.Test)2 EntityManager (javax.persistence.EntityManager)1 Priority (org.hibernate.envers.test.Priority)1 BidirectionalEagerHbmRefEdPK (org.hibernate.envers.test.entities.onetoone.BidirectionalEagerHbmRefEdPK)1