Examples of DependentFieldsPC


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

    }

    public void setUp() throws Exception {
        deleteAll(DependentFieldsPC.class);

        DependentFieldsPC root = new DependentFieldsPC();
        root.setRelation(new DependentFieldsPC());
        root.getList().add(new DependentFieldsPC());
        root.getMap().put("key", new DependentFieldsPC());
        root.setDependentRelation(new DependentFieldsPC());
        root.getDependentRelation().setDependentRelation
            (new DependentFieldsPC());
        root.getDependentList().add(new DependentFieldsPC());
        root.getDependentMap().put("key", new DependentFieldsPC());

        DependentFieldsPC repeat = new DependentFieldsPC();
        root.getDependentList().add(repeat);
        root.getDependentMap().put("repeat", repeat);

        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
View Full Code Here

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

        checkFields();
    }

    private void delete(boolean load, int action) {
        OpenJPAEntityManager pm = getPM(true, true);
        DependentFieldsPC root;
        Object rel = null;
        Object depRel = null;
        Object coll = null;
        Object depColl = null;
        Object map = null;
        Object depMap = null;
        Object repeat = null;
        Object deep = null;
        while (true) {
            startTx(pm);
            root = (DependentFieldsPC) pm.find(DependentFieldsPC.class, _root);
            if (load) {
                rel = root.getRelation();
                assertNotNull(rel);
                depRel = root.getDependentRelation();
                assertNotNull(depRel);
                deep = ((DependentFieldsPC) depRel).getDependentRelation();
                assertNotNull(deep);
                coll = root.getList().iterator().next();
                assertNotNull(coll);
                Iterator itr = root.getDependentList().iterator();
                depColl = itr.next();
                repeat = itr.next();
                assertNotNull(depColl);
                assertNotNull(repeat);
                map = root.getMap().get("key");
                assertNotNull(map);
                depMap = root.getDependentMap().get("key");
                assertNotNull(depMap);

                // pcl: test both depColl and repeat, since they might
                // have been out of order above.
                Object o = root.getDependentMap().get("repeat");
                if (o != repeat)
                    fail("dependent map does not contain 'repeat'");
            }
            pm.remove(root);
View Full Code Here

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

    }

    private void nullDeletesDependent(int action) {
        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
        DependentFieldsPC pc;
        DependentFieldsPC depRel;
        while (true) {
            startTx(pm);
            pc = (DependentFieldsPC) pm.find(DependentFieldsPC.class, _root);
            depRel = pc.getDependentRelation();
            assertEquals(_depRel, pm.getObjectId(depRel));
View Full Code Here

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

    }

    private void removeDeletesDependent(int action) {
        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
        DependentFieldsPC pc;
        DependentFieldsPC depColl;
        DependentFieldsPC depMap;
        List list;
        Map map;
        while (true) {
            startTx(pm);
            pc = (DependentFieldsPC) pm.find(DependentFieldsPC.class, _root);
View Full Code Here

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

    }

    private void moveDependentInContainer(int action) {
        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
        DependentFieldsPC pc;
        DependentFieldsPC depColl;
        DependentFieldsPC depMap;
        List list;
        Map map;
        while (true) {
            startTx(pm);
            pc = (DependentFieldsPC) pm.find(DependentFieldsPC.class, _root);
View Full Code Here

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

    }

    private void refedDependentNotDeleted(int action) {
        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
        DependentFieldsPC pc;
        DependentFieldsPC newPC = null;
        DependentFieldsPC depRel;
        while (true) {
            startTx(pm);
            pc = (DependentFieldsPC) pm.find(DependentFieldsPC.class, _root);
            if (newPC == null)
                newPC = new DependentFieldsPC();
            depRel = pc.getDependentRelation();
            newPC.setDependentRelation(depRel);
            pc.setDependentRelation(null);
            pm.persist(newPC);
View Full Code Here

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

    }

    private void nullSharedDependent(int action) {
        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
        DependentFieldsPC pc;
        DependentFieldsPC repeat;
        List list;
        Map map;
        while (true) {
            startTx(pm);
            pc = (DependentFieldsPC) pm.find(DependentFieldsPC.class, _root);
View Full Code Here

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

    }

    private void clearDependentOfDetachedTest(boolean mapped) {
        deleteAll(DependentFieldsPC.class);

        DependentFieldsPC owner = new DependentFieldsPC();
        for (int i = 0; i < 2; i++) {
            DependentFieldsPC child = new DependentFieldsPC();
            if (mapped) {
                owner.getDependentMappedList().add(child);
                child.setOwner(owner);
            } else
                owner.getDependentInverseKeyList().add(child);
        }

        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
        startTx(pm);
        pm.persist(owner);
        endTx(pm);
        Object oid = pm.getObjectId(owner);
        assertEquals(3,
            ((Extent) pm.createExtent(DependentFieldsPC.class, true))
                .list().size());
        endEm(pm);

        pm = (OpenJPAEntityManager) currentEntityManager();
        owner = (DependentFieldsPC) pm.find(DependentFieldsPC.class, oid);
        if (mapped)
            assertEquals(2, owner.getDependentMappedList().size());
        else
            assertEquals(2, owner.getDependentInverseKeyList().size());
        DependentFieldsPC detached = (DependentFieldsPC) pm.detach(owner);
        endEm(pm);

        if (mapped) {
            assertEquals(2, detached.getDependentMappedList().size());
            detached.getDependentMappedList().clear();
        } else {
            assertEquals(2, detached.getDependentInverseKeyList().size());
            detached.getDependentInverseKeyList().clear();
        }

        pm = (OpenJPAEntityManager) currentEntityManager();
        startTx(pm);
        owner = (DependentFieldsPC) pm.merge(detached);
View Full Code Here

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

    }

    public void setUp() throws Exception {
        deleteAll(DependentFieldsPC.class);

        DependentFieldsPC root = new DependentFieldsPC();
        root.setRelation(new DependentFieldsPC());
        root.getList().add(new DependentFieldsPC());
        root.getMap().put("key", new DependentFieldsPC());
        root.setDependentRelation(new DependentFieldsPC());
        root.getDependentRelation().setDependentRelation
            (new DependentFieldsPC());
        root.getDependentList().add(new DependentFieldsPC());
        root.getDependentMap().put("key", new DependentFieldsPC());

        DependentFieldsPC repeat = new DependentFieldsPC();
        root.getDependentList().add(repeat);
        root.getDependentMap().put("repeat", repeat);

        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) currentEntityManager();
View Full Code Here

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

        checkFields();
    }

    private void delete(boolean load, int action) {
        OpenJPAEntityManager pm = getPM(true, true);
        DependentFieldsPC root;
        Object rel = null;
        Object depRel = null;
        Object coll = null;
        Object depColl = null;
        Object map = null;
        Object depMap = null;
        Object repeat = null;
        Object deep = null;
        while (true) {
            startTx(pm);
            root = (DependentFieldsPC) pm.find(DependentFieldsPC.class, _root);
            if (load) {
                rel = root.getRelation();
                assertNotNull(rel);
                depRel = root.getDependentRelation();
                assertNotNull(depRel);
                deep = ((DependentFieldsPC) depRel).getDependentRelation();
                assertNotNull(deep);
                coll = root.getList().iterator().next();
                assertNotNull(coll);
                Iterator itr = root.getDependentList().iterator();
                depColl = itr.next();
                repeat = itr.next();
                assertNotNull(depColl);
                assertNotNull(repeat);
                map = root.getMap().get("key");
                assertNotNull(map);
                depMap = root.getDependentMap().get("key");
                assertNotNull(depMap);

                // pcl: test both depColl and repeat, since they might
                // have been out of order above.
                Object o = root.getDependentMap().get("repeat");
                if (o != repeat)
                    fail("dependent map does not contain 'repeat'");
            }
            pm.remove(root);
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.