Package org.apache.openjpa.persistence.kernel.common.apps

Examples of org.apache.openjpa.persistence.kernel.common.apps.PersistentMapHolder


    public void setUp() {
        deleteAll(PersistentMapHolder.class);
        OpenJPAEntityManager pm = getPM();
        startTx(pm);

        pm.persist(new PersistentMapHolder());

        endTx(pm);
        endEm(pm);
    }
View Full Code Here


    private void testMap(int num, String name, Class keyClass, Class valueClass)
        throws Exception {
        OpenJPAEntityManager srcpm = getPM(true, true);
        startTx(srcpm);

        PersistentMapHolder holder = getHolder(srcpm);
        Map map = holder.getNamedMap(name);
        Map internalMap = new HashMap();

        for (int i = 0; i < num; i++) {
            Object key = keyInstance(keyClass);
            Object value = keyInstance(valueClass);
            map.put(key, value);
            internalMap.put(key, value);

            assertEquals(map.get(key), internalMap.get(key));
        }
        endTx(srcpm);

        OpenJPAEntityManager pm = getPM();
        startTx(pm);
//        holder = getHolder(pm);
        map = holder.getNamedMap(name);
        for (Iterator i = internalMap.keySet().iterator(); i.hasNext();) {
            Object k = i.next();
            assertEquals(map.get(k), internalMap.get(k));
        }
        endTx(pm);
View Full Code Here

        pc.setElementData("foo");

        int max = 5;

        for (int i = 0; i < max; i++) {
            PersistentMapHolder holder = new PersistentMapHolder();
            for (int j = 0; j < i; j++) {
                holder.getNamedMap(mapName).put("key" + j, pc);
            }
            pm.persist(holder);
        }

        endTx(pm);
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.kernel.common.apps.PersistentMapHolder

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.