Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.createNativeQuery()


        StateImagePC2 pc1 =
            (StateImagePC2) ((Collection) q1.getCandidateCollection()).
            iterator().next();
        q1.closeAll();
       
        OpenJPAQuery q2 = pm2.createNativeQuery("",StateImagePC2.class);
        //FIXME jthomas
        //q2.setOrdering("intField ascending");
        StateImagePC2 pc2 =
            (StateImagePC2) ((Collection) q2.getCandidateCollection()).
            iterator().next();
View Full Code Here


        super(test);
    }

    public void testQuery() {
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        OpenJPAQuery q = pm.createNativeQuery("",NoClassColumn.class);
        //FIXME jthomas
        //q.declareParameters("java.lang.String input");
        //q.setFilter("test==input");
        Map params = new HashMap();
        params.put("input", "blah");
View Full Code Here

        pm.close();
    }

    public void testNamedQuery() {
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        OpenJPAQuery q = pm.createNativeQuery("cls",NamedSQL.class);

        assertEquals("javax.jdo.query.SQL", ((OpenJPAQuery) q).getLanguage());
        Collection results = (Collection) q.getCandidateCollection();
        for (Iterator i = results.iterator(); i.hasNext();)
            assertEquals(4, ((NamedSQL) i.next()).getNum());
View Full Code Here

       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "stringCollection");
        fetch.setFetchBatchSize(-1);
        OpenJPAQuery q = pm.createNativeQuery("",EagerOuterJoinPC.class);
       
        //FIXME jthomas
        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
View Full Code Here

       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "stringList");
        fetch.setFetchBatchSize(-1);
        OpenJPAQuery q = pm.createNativeQuery("",EagerOuterJoinPC.class);
        //FIXME jthomas
        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
        assertEquals(2, results.size());
View Full Code Here

       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "oneManyCollection");
        fetch.setFetchBatchSize(-1);
        OpenJPAQuery q = pm.createNativeQuery("",EagerOuterJoinPC.class);
        //FIXME jthomas
        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
        assertEquals(2, results.size());
View Full Code Here

       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "manyManyCollection");
        fetch.setFetchBatchSize(-1);
        OpenJPAQuery q = pm.createNativeQuery("",EagerOuterJoinPC.class);
        //FIXME jthomas
        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
        assertEquals(2, results.size());
View Full Code Here

       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "manyManyList");
        fetch.setFetchBatchSize(-1);
        OpenJPAQuery q = pm.createNativeQuery("",EagerOuterJoinPC.class);
        //FIXME jthomas
        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
        assertEquals(2, results.size());
View Full Code Here

        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "stringCollection");
        fetch.addField(EagerOuterJoinPC.class, "manyManyList");
        fetch.setFetchBatchSize(-1);
       
        OpenJPAQuery q = pm.createNativeQuery("",EagerOuterJoinPC.class);
        //FIXME jthomas
        //q.setOrdering("name ascending");
        Collection results = (Collection) q.getResultList();
       
        assertEquals(2, results.size());
View Full Code Here

       
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
        fetch.addField(EagerOuterJoinPC.class, "stringList");
        fetch.setFetchBatchSize(3);
        OpenJPAQuery q = pm.createNativeQuery("",EagerOuterJoinPC.class);
        //FIXME jthomas
        //q.setOrdering("name ascending");
        List results = (List) q.getResultList();
        assertEquals(10, results.size());
       
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.