Examples of RootEntity


Examples of org.apache.openjpa.persistence.inheritance.entities.testinterfaces.RootEntity

        for (InheritanceEntityMapping[] tEntities : allEntityGroups ) {
            int idx = 0;
           
            try {
                for (InheritanceEntityMapping tEntity : tEntities) {
                    RootEntity entity = (RootEntity)
                        EntityMapping.createEntityObjectInstance(tEntity);
                    entity.updateId(new Integer(idx++));
                    entity.setRootEntityData("Root " + (idx - 1));
                   
                    em.getTransaction().begin();
                    em.persist(entity);
                    em.getTransaction().commit();
                }
            } catch (Exception e) {
                fail("Test failed with Exception\n" + e);
            }
           
            List<RootEntity> resultList = (List<RootEntity>) em.createQuery(
                    "SELECT e FROM " + tEntities[0].getEntityName() +
                    " e ORDER BY e.id").getResultList();
            assertEquals(tEntities.length, resultList.size());
     
            idx = 0;
            for (Object obj : resultList) {
                RootEntity entity = (RootEntity) obj;
                Class<? extends RootEntity> actualType = entity.getClass();
                Class<? extends RootEntity> expectedType =
                    tEntities[idx].getEntityClass();
               
                assertEquals(
                        "Assert Entity " + (idx + 1) + "is entity of type " +
View Full Code Here

Examples of org.apache.openjpa.persistence.inheritance.entities.testinterfaces.RootEntity

        for (InheritanceEntityMapping[] tEntities : allEntityGroups ) {
            int idx = 0;
           
            try {
                for (InheritanceEntityMapping tEntity : tEntities) {
                    RootEntity entity = (RootEntity)
                        EntityMapping.createEntityObjectInstance(tEntity);
                    entity.updateId(new Integer(idx++));
                    entity.setRootEntityData("Root " + (idx - 1));
                   
                    em.getTransaction().begin();
                    em.persist(entity);
                    em.getTransaction().commit();
                    em.clear();
                }
            } catch (Exception e) {
                fail("Test failed with Exception\n" + e);
            }
           
            List<RootEntity>  resultList = (List<RootEntity>) em.createQuery(
                    "SELECT e FROM " + tEntities[0].getEntityName() +
                    " e ORDER BY e.id").getResultList();
            assertEquals(tEntities.length, resultList.size());
     
            idx = 0;
            for (Object obj : resultList) {
                RootEntity entity = (RootEntity) obj;
                Class<? extends RootEntity> actualType = entity.getClass();
                Class<? extends RootEntity> expectedType =
                    tEntities[idx].getEntityClass();
               
                assertEquals(
                        "Assert Entity " + (idx + 1) + "is entity of type " +
View Full Code Here

Examples of org.apache.openjpa.persistence.inheritance.entities.testinterfaces.RootEntity

        for (InheritanceEntityMapping[] tEntities : allEntityGroups ) {
            // Populate Database
            int idx = 0;
            try {
                for (InheritanceEntityMapping tEntity : tEntities) {
                    RootEntity entity = (RootEntity)
                        EntityMapping.createEntityObjectInstance(tEntity);
                    entity.updateId(new Integer(idx++));
                    entity.setRootEntityData("Root " + (idx - 1));
                   
                    em.getTransaction().begin();
                    em.persist(entity);
                    em.getTransaction().commit();
                   
View Full Code Here

Examples of org.hibernate.envers.test.performance.complex.RootEntity

            newEntityManager();
            EntityManager entityManager = getEntityManager();

            entityManager.getTransaction().begin();

            RootEntity re = new RootEntity();
            re.setId(idCounter++);
            re.setData1("data1");
            re.setData2("data2");
            re.setDate1(new Date());
            re.setNumber1(123);
            re.setNumber2(456);
            re.setChild1(createChildEntity1());
            re.setChild2(createChildEntity1());
            re.setChild3(createChildEntity1());

            start();
            entityManager.persist(re);           
            entityManager.getTransaction().commit();
            stop();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.