Package org.hibernate.envers.test.entities.customtype

Examples of org.hibernate.envers.test.entities.customtype.Component


        CompositeCustomTypeEntity ccte = new CompositeCustomTypeEntity();

        // Revision 1 (persisting 1 entity)
        em.getTransaction().begin();

        ccte.setComponent(new Component("a", 1));

        em.persist(ccte);

        em.getTransaction().commit();

        // Revision 2 (changing the component)
        em.getTransaction().begin();

        ccte = em.find(CompositeCustomTypeEntity.class, ccte.getId());

        ccte.getComponent().setProp1("b");

        em.getTransaction().commit();

        // Revision 3 (replacing the component)
        em.getTransaction().begin();

        ccte = em.find(CompositeCustomTypeEntity.class, ccte.getId());

        ccte.setComponent(new Component("c", 3));

        em.getTransaction().commit();

        //
View Full Code Here


    public void testHistoryOfCcte() {
        CompositeCustomTypeEntity rev1 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 1);
        CompositeCustomTypeEntity rev2 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 2);
        CompositeCustomTypeEntity rev3 = getAuditReader().find(CompositeCustomTypeEntity.class, ccte_id, 3);

        assert rev1.getComponent().equals(new Component("a", 1));
        assert rev2.getComponent().equals(new Component("b", 1));
        assert rev3.getComponent().equals(new Component("c", 3));
    }
View Full Code Here

TOP

Related Classes of org.hibernate.envers.test.entities.customtype.Component

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.