Package org.apache.openjpa.kernel

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


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

        List l = (List) q.execute();
        assertNull(l.get(0));
        CacheTestHelper.iterate(l);
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        l = (List) q.execute();
View Full Code Here


        List l = (List) q.execute();
        assertNull(l.get(0));
        CacheTestHelper.iterate(l);
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        l = (List) q.execute();
        assertNull(l.get(0));
    }
}
View Full Code Here

        Query q = broker.newQuery(JPQLParser.LANG_JPQL,
            "select a from " +
                CacheObjectAChild1.class.getSimpleName() +
                " a where a.date < :p_date");
        Date d = new Date();
        Collection c = (Collection) q.execute(new Object[]{ d });
        CacheTestHelper.iterate(c);
        int initialSize = c.size();
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE,
            new Object[]{ d });
        d.setTime(_startDate.getTime());
View Full Code Here

        CacheTestHelper.assertInCache(this, q, Boolean.TRUE,
            new Object[]{ d });
        d.setTime(_startDate.getTime());
        CacheTestHelper.assertInCache(this, q, Boolean.FALSE,
            new Object[]{ d });
        c = (Collection) q.execute(new Object[]{ d });

        assertFalse(new Integer(initialSize).equals(new Integer(c.size())));
    }

    //FIXME Seetha Nov 10,2006
View Full Code Here

        Broker broker = _factory.newBroker();
        Query q =
            broker.newQuery(JPQLParser.LANG_JPQL, "select max(a.age) FROM " +
                CacheObjectAChild1.class.getSimpleName() + " a");

        Object o = q.execute();
        assertEquals(Long.class, o.getClass());
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        o = q.execute();
        assertEquals(Long.class, o.getClass());
View Full Code Here

        Object o = q.execute();
        assertEquals(Long.class, o.getClass());
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        o = q.execute();
        assertEquals(Long.class, o.getClass());
    }

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

        Broker broker = _factory.newBroker();
        Query q =
            broker.newQuery(JPQLParser.LANG_JPQL, "select max(a.age) FROM " +
                CacheObjectAChild1.class.getSimpleName() + " a");
        q.setUnique(false);
        List res = (List) q.execute();
        assertEquals(1, res.size());
        Object o = res.get(0);
        assertEquals(Long.class, o.getClass());
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);
View Full Code Here

        assertEquals(1, res.size());
        Object o = res.get(0);
        assertEquals(Long.class, o.getClass());
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        res = (List) q.execute();
        assertEquals(1, res.size());
        o = res.get(0);
        assertEquals(Long.class, o.getClass());
    }
View Full Code Here

    public void testProjectionResultIsCached() {
        Broker broker = _factory.newBroker();
        Query q = broker.newQuery(JPQLParser.LANG_JPQL, "select a.age FROM " +
            CacheObjectAChild1.class.getSimpleName() + " a");
        Collection c = (Collection) q.execute();
        CacheTestHelper.iterate(c);
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        c = (Collection) q.execute();
        Object o = c.iterator().next();
View Full Code Here

            CacheObjectAChild1.class.getSimpleName() + " a");
        Collection c = (Collection) q.execute();
        CacheTestHelper.iterate(c);
        CacheTestHelper.assertInCache(this, q, Boolean.TRUE);

        c = (Collection) q.execute();
        Object o = c.iterator().next();
        assertEquals(Long.class, o.getClass());
    }

    public void testProjectionOfThisIsCached() {
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.