Package org.apache.openjpa.kernel

Examples of org.apache.openjpa.kernel.Query.execute()


        q.setResultType(HashMap.class);

        if (unique) {
            mapResultHelper(q.execute(), recordClasses, results, inCache);
        } else {
            for (Iterator iter = ((Collection) q.execute()).iterator();
                iter.hasNext();)
                mapResultHelper(iter.next(), recordClasses, results, inCache);
        }

        CacheTestHelper.assertInCache(this, q, new Boolean(inCache));
View Full Code Here


        }

        CacheTestHelper.assertInCache(this, q, new Boolean(inCache));

        if (unique) {
            mapResultHelper(q.execute(), recordClasses, results, inCache);
        } else {
            for (Iterator iter = ((List) q.execute()).iterator(); iter
                .hasNext();)
                mapResultHelper(iter.next(), recordClasses, results, inCache);
        }
View Full Code Here

        CacheTestHelper.assertInCache(this, q, new Boolean(inCache));

        if (unique) {
            mapResultHelper(q.execute(), recordClasses, results, inCache);
        } else {
            for (Iterator iter = ((List) q.execute()).iterator(); iter
                .hasNext();)
                mapResultHelper(iter.next(), recordClasses, results, inCache);
        }
    }
View Full Code Here

        ArrayList<String> l = new ArrayList<String>();
        l.add(result);
        Collection res = (result == null) ? null : l;
        Query q = setUpQuery(unique, res);
        if (unique)
            assertEquals(recordClass, q.execute().getClass());
        else {
            q.setUnique(unique);
            for (Iterator iter = ((List) q.execute()).iterator(); iter
                .hasNext();)
                assertEquals(recordClass, iter.next().getClass());
View Full Code Here

        Query q = setUpQuery(unique, res);
        if (unique)
            assertEquals(recordClass, q.execute().getClass());
        else {
            q.setUnique(unique);
            for (Iterator iter = ((List) q.execute()).iterator(); iter
                .hasNext();)
                assertEquals(recordClass, iter.next().getClass());
        }

        CacheTestHelper.assertInCache(this, q, new Boolean(inCache));
View Full Code Here

        }

        CacheTestHelper.assertInCache(this, q, new Boolean(inCache));

        if (unique) {
            assertEquals(recordClass, q.execute().getClass());
        } else {
            for (Iterator iter = ((List) q.execute()).iterator(); iter
                .hasNext();)
                assertEquals(recordClass, iter.next().getClass());
        }
View Full Code Here

        CacheTestHelper.assertInCache(this, q, new Boolean(inCache));

        if (unique) {
            assertEquals(recordClass, q.execute().getClass());
        } else {
            for (Iterator iter = ((List) q.execute()).iterator(); iter
                .hasNext();)
                assertEquals(recordClass, iter.next().getClass());
        }
    }
View Full Code Here

        }

        CacheTestHelper.iterate(l);
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        l = (List) q.execute();
        assertEquals(CacheObjectAChild1.class, l.get(0).getClass());
    }

    public void testNonNullRelationOfSameTypeAsCandidate() {
        Broker broker = _factory.newBroker();
View Full Code Here

        Broker broker = _factory.newBroker();
        Query q = broker.newQuery(JPQLParser.LANG_JPQL, "select a.o FROM " +
            SelfReferencingCacheTestObject.class.getSimpleName() +
            " a where a.o IS NOT NULL");

        List l = (List) q.execute();
        assertEquals(SelfReferencingCacheTestObject.class,
            l.get(0).getClass());
        assertEquals("bar",
            ((SelfReferencingCacheTestObject) l.get(0)).getStr());
        CacheTestHelper.iterate(l);
View Full Code Here

        assertEquals("bar",
            ((SelfReferencingCacheTestObject) l.get(0)).getStr());
        CacheTestHelper.iterate(l);
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        l = (List) q.execute();
        assertEquals(SelfReferencingCacheTestObject.class,
            l.get(0).getClass());
        assertEquals("bar",
            ((SelfReferencingCacheTestObject) l.get(0)).getStr());
    }
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.