Package org.apache.openjpa.persistence.simple

Examples of org.apache.openjpa.persistence.simple.AllFieldTypes


        assertEquals(String.class,
            cachedFieldData.getClass().getComponentType());

        // make sure that the returned results are correct
        EntityManager em = emf.createEntityManager();
        AllFieldTypes aft = em.find(AllFieldTypes.class, jpaOid);
        assertTrue(Arrays.equals(STRINGS, aft.getArrayOfStrings()));
        assertNotSame(STRINGS, aft.getArrayOfStrings());
        em.close();
    }
View Full Code Here


        assertTrue(cachedFieldData.getClass().isArray());
        assertEquals(int.class, cachedFieldData.getClass().getComponentType());

        // make sure that the returned results are correct
        EntityManager em = emf.createEntityManager();
        AllFieldTypes aft = em.find(AllFieldTypes.class, jpaOid);
        assertTrue(Arrays.equals(INTS, aft.getArrayOfInts()));
        assertNotSame(INTS, aft.getArrayOfInts());
        em.close();
    }
View Full Code Here

            Persistence.createEntityManagerFactory("test", props));
        _conf = (JDBCConfiguration) emf.getConfiguration();
       
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(new AllFieldTypes());
        em.getTransaction().commit();
        em.close();
    }
View Full Code Here

        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        DBDictionary dict = ((JDBCConfiguration) em.getConfiguration())
            .getDBDictionaryInstance();
       
        em.getTransaction().begin();
        AllFieldTypes a = new AllFieldTypes();
        a.setIntField(123);
        em.persist(a);
        em.getTransaction().commit();
        em.clear();

        sql.clear();
View Full Code Here

            HandlerToRelationMapInstance.class);
        assertEquals(HandlerRelationMapTableFieldStrategy.class,
            cm.getFieldMapping("map").getStrategy().getClass());

        HandlerToRelationMapInstance o = new HandlerToRelationMapInstance();
        o.getMap().put("foo", new AllFieldTypes());
        em.getTransaction().begin();
        em.persist(o);
        em.getTransaction().commit();
        em.close();
    }
View Full Code Here

            RelationToHandlerMapInstance.class);
        assertEquals(RelationHandlerMapTableFieldStrategy.class,
            cm.getFieldMapping("aftMap").getStrategy().getClass());

        RelationToHandlerMapInstance o = new RelationToHandlerMapInstance();
        AllFieldTypes key = new AllFieldTypes();
        o.getMap().put(key, "foo");
        em.getTransaction().begin();
        em.persist(o);
        em.getTransaction().commit();
        em.close();
View Full Code Here

            RelationToRelationMapInstance.class);
        assertEquals(RelationRelationMapTableFieldStrategy.class,
            cm.getFieldMapping("map").getStrategy().getClass());

        RelationToRelationMapInstance o = new RelationToRelationMapInstance();
        AllFieldTypes key = new AllFieldTypes();
        AllFieldTypes val = new AllFieldTypes();
        o.getMap().put(key, val);
        em.getTransaction().begin();
        em.persist(o);
        em.getTransaction().commit();
        em.close();
View Full Code Here

            CLEAR_TABLES,
            AllFieldTypes.class, CascadeParent.class, CascadeChild.class);

        OpenJPAEntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        AllFieldTypes pc = new AllFieldTypes();
        pc.setStringField("DeleteMe");
        em.persist(pc);
        oid = em.getObjectId(pc);
        em.getTransaction().commit();
        em.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.simple.AllFieldTypes

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.