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

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


    @BeforeClass(dependsOnMethods = "init")
    public void initData() {
        EntityManager em = getEntityManager();

        ParametrizedCustomTypeEntity pcte = new ParametrizedCustomTypeEntity();

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

        pcte.setStr("U");

        em.persist(pcte);

        em.getTransaction().commit();

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

        pcte = em.find(ParametrizedCustomTypeEntity.class, pcte.getId());

        pcte.setStr("V");

        em.getTransaction().commit();

        //

        pcte_id = pcte.getId();
    }
View Full Code Here


        assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(ParametrizedCustomTypeEntity.class, pcte_id));
    }

    @Test
    public void testHistoryOfCcte() {
        ParametrizedCustomTypeEntity rev1 = getAuditReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 1);
        ParametrizedCustomTypeEntity rev2 = getAuditReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 2);

        assert "xUy".equals(rev1.getStr());
        assert "xVy".equals(rev2.getStr());
    }
View Full Code Here

TOP

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

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.