Examples of ProxyCollection


Examples of com.impetus.kundera.proxy.collection.ProxyCollection

                            PropertyAccessorHelper.set(target, relationField, sourceRelationObject);
                            continue;
                        }
                        else if (ProxyHelper.isKunderaProxyCollection(sourceRelationObject))
                        {
                            ProxyCollection pc = ((ProxyCollection) sourceRelationObject).getCopy();
                            pc.setOwner(target);
                            PropertyAccessorHelper.set(target, relationField, pc);
                            continue;
                        }

                        Object targetRelationObject = null;
View Full Code Here

Examples of com.impetus.kundera.proxy.collection.ProxyCollection

        }
        else if (relation.getType().equals(ForeignKey.ONE_TO_MANY)
                || relation.getType().equals(ForeignKey.MANY_TO_MANY))
        {
            ProxyCollection proxyCollection = null;

            if (relation.getPropertyType().isAssignableFrom(Set.class))
            {
                proxyCollection = new ProxySet(pd, relation);

            }
            else if (relation.getPropertyType().isAssignableFrom(List.class))
            {
                proxyCollection = new ProxyList(pd, relation);
            }

            else if (relation.getPropertyType().isAssignableFrom(Map.class))
            {
                proxyCollection = new ProxyMap(pd, relation);
            }

            proxyCollection.setOwner(entity);
            proxyCollection.setRelationsMap(relationsMap);

            PropertyAccessorHelper.set(entity, relation.getProperty(), proxyCollection);
        }
    }
View Full Code Here

Examples of org.apache.openjpa.util.ProxyCollection

        d = findDepartment(em, d.getId());
        assertAnySQLAnyOrder("SELECT .* DC_DEP_PRD .*");
        resetSQL();
        products = d.getProducts();
        assertTrue(products instanceof DelayedProxy);
        ProxyCollection pxycoll = (ProxyCollection)products;
        assertFalse(pxycoll.getOwner().isDelayed(pxycoll.getOwnerField()));
        Product p3 = getProduct(products, 0);
        assertTrue(products.contains(p3));
        assertEquals(2, products.size());
        assertNoneSQLAnyOrder("SELECT .* DC_DEPARTMENT .*", "SELECT .* DC_DEP_PRD .*");
        em.close();
View Full Code Here

Examples of org.apache.openjpa.util.ProxyCollection

        resetSQL();
        Collection<Location> locations = d.getLocations();
        assertAnySQLAnyOrder("SELECT .* DC_DEP_LOC .*");
        resetSQL();
        assertTrue(locations instanceof DelayedProxy);
        ProxyCollection pxycoll = (ProxyCollection)locations;
        assertFalse(pxycoll.getOwner().isDelayed(pxycoll.getOwnerField()));
        assertEquals(1, locations.size());
        assertNoneSQLAnyOrder("SELECT .* DC_DEPARTMENT .*", "SELECT .* DC_DEP_LOC .*");
        em.close();
    }
View Full Code Here

Examples of org.apache.openjpa.util.ProxyCollection

       
        d = findDepartment(em, d.getId());
        assertAnySQLAnyOrder("SELECT .* DC_DEP_AWD .*");
        resetSQL();
        awards = d.getAwards();
        ProxyCollection pxycoll = (ProxyCollection)awards;
        assertFalse(pxycoll.getOwner().isDelayed(pxycoll.getOwnerField()));
        assertNoneSQLAnyOrder("SELECT .* DC_DEP_AWD .*");
        assertTrue(awards instanceof DelayedProxy);
        assertEquals(3,awards.size());
        assertNoneSQLAnyOrder("SELECT .* DC_DEP_AWD .*");
       
View Full Code Here

Examples of org.apache.openjpa.util.ProxyCollection

       
        m = ui.getMember();
        resetSQL();
        accounts = m.getAccounts();
       
        ProxyCollection pxycoll = (ProxyCollection)accounts;
        assertTrue(pxycoll.getOwner().isDelayed(pxycoll.getOwnerField()));
        assertNoneSQLAnyOrder("SELECT .* DC_ACCOUNT .*");
        assertTrue(accounts instanceof DelayedProxy);
        // Trigger a load via iterator
        int count = 0;
        for (IAccount a : accounts) {
View Full Code Here

Examples of org.apache.openjpa.util.ProxyCollection

        d = findDepartment(em, d.getId());
        assertAnySQLAnyOrder("SELECT .* DC_DEP_PRD .*");
        resetSQL();
        products = d.getProducts();
        assertTrue(products instanceof DelayedProxy);
        ProxyCollection pxycoll = (ProxyCollection)products;
        assertFalse(pxycoll.getOwner().isDelayed(pxycoll.getOwnerField()));
        Product p3 = getProduct(products, 0);
        assertTrue(products.contains(p3));
        assertEquals(2, products.size());
        assertNoneSQLAnyOrder("SELECT .* DC_DEPARTMENT .*", "SELECT .* DC_DEP_PRD .*");
        em.close();
View Full Code Here

Examples of org.apache.openjpa.util.ProxyCollection

        resetSQL();
        Collection<Location> locations = d.getLocations();
        assertAnySQLAnyOrder("SELECT .* DC_DEP_LOC .*");
        resetSQL();
        assertTrue(locations instanceof DelayedProxy);
        ProxyCollection pxycoll = (ProxyCollection)locations;
        assertFalse(pxycoll.getOwner().isDelayed(pxycoll.getOwnerField()));
        assertEquals(1, locations.size());
        assertNoneSQLAnyOrder("SELECT .* DC_DEPARTMENT .*", "SELECT .* DC_DEP_LOC .*");
        em.close();
    }
View Full Code Here

Examples of org.apache.openjpa.util.ProxyCollection

       
        d = findDepartment(em, d.getId());
        assertAnySQLAnyOrder("SELECT .* DC_DEP_AWD .*");
        resetSQL();
        awards = d.getAwards();
        ProxyCollection pxycoll = (ProxyCollection)awards;
        assertFalse(pxycoll.getOwner().isDelayed(pxycoll.getOwnerField()));
        assertNoneSQLAnyOrder("SELECT .* DC_DEP_AWD .*");
        assertTrue(awards instanceof DelayedProxy);
        assertEquals(3,awards.size());
        assertNoneSQLAnyOrder("SELECT .* DC_DEP_AWD .*");
       
View Full Code Here

Examples of org.apache.openjpa.util.ProxyCollection

       
        m = ui.getMember();
        resetSQL();
        accounts = m.getAccounts();
       
        ProxyCollection pxycoll = (ProxyCollection)accounts;
        assertTrue(pxycoll.getOwner().isDelayed(pxycoll.getOwnerField()));
        assertNoneSQLAnyOrder("SELECT .* DC_ACCOUNT .*");
        assertTrue(accounts instanceof DelayedProxy);
        // Trigger a load via iterator
        int count = 0;
        for (IAccount a : accounts) {
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.