Package org.apache.openjpa.persistence

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


        //q1.setOrdering("intField ascending");
        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();
        q2.closeAll();
View Full Code Here


    }

    public void testProjections()
        throws Exception {
        OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
        OpenJPAQuery q = pm.createNativeQuery("",Relations.class);
        //FIXME jthomas
        /*
        q.setResult("base, baseSub1, baseSub1Sub2");
        q.setUnique(true);
        Object[] res = (Object[]) q.execute();
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

    }
   
    private void eagerParallelWithNonDistinctQuery(int fetchSize)
    throws Exception {
        OpenJPAEntityManager pm = getPM();
        OpenJPAQuery q = pm.createNativeQuery("stringField.startsWith ('pc')",HelperPC2.class);
        //FIXME jthomas
        //q.setOrdering("stringField ascending");
        q.getFetchPlan().setFetchBatchSize(fetchSize);
        List res = (List) q.getResultList();
       
View Full Code Here

    }
   
    private void eagerParallelWithDistinctQuery(int fetchSize)
    throws Exception {
        OpenJPAEntityManager pm = getPM();
        OpenJPAQuery q =  pm.createNativeQuery("helperCollection.contains (h) && h.stringField == 'shared'",HelperPC2.class);
        //FIXME  jthomas
        //q.setOrdering("stringField ascending");
        q.getFetchPlan().setFetchBatchSize(fetchSize);
        List res = (List) q.getResultList();
       
View Full Code Here

    }
   
    private void nestedEagerParallel(int fetchSize)
    throws Exception {
        OpenJPAEntityManager pm = getPM();
        OpenJPAQuery q = pm.createNativeQuery("",HelperPC2.class);
        //FIXME jthomas
        //q.setOrdering("stringField ascending");
        List helpers = (List) q.getResultList();
       
        EagerPC eager1 = new EagerPC();
View Full Code Here

        pm.persist(eager1);
        pm.persist(eager2);
        endTx(pm);;
        // make sure subclasses selected, etc
        //FIXME jthomas
        pm.createNativeQuery("",EagerPC.class).getResultList();
        pm.close();
        sql.clear();
       
        pm = getPM();
        q = pm.createNativeQuery("stringField.startsWith ('eager')",EagerPC.class);
View Full Code Here

        pm.createNativeQuery("",EagerPC.class).getResultList();
        pm.close();
        sql.clear();
       
        pm = getPM();
        q = pm.createNativeQuery("stringField.startsWith ('eager')",EagerPC.class);
        //FIXME jthomas
        //q.setOrdering("stringField ascending");
        q.getFetchPlan().setFetchBatchSize(fetchSize);
        List res = (List) q.getResultList();
       
View Full Code Here

        pm.persist(pc);
        pm.commit();
        pm.close();
       
        pm = (OpenJPAEntityManager)currentEntityManager();;
        OpenJPAQuery q = pm.createNativeQuery("stringField == 'h2'",HelperPC.class);
        //FIXME jthomas
        //q.setUnique(true);
        HelperPC h2 = (HelperPC) q.getSingleResult();
       
        q = pm.createNativeQuery("helpers.containsKey ('h2')",pc.getClass());
View Full Code Here

        OpenJPAQuery q = pm.createNativeQuery("stringField == 'h2'",HelperPC.class);
        //FIXME jthomas
        //q.setUnique(true);
        HelperPC h2 = (HelperPC) q.getSingleResult();
       
        q = pm.createNativeQuery("helpers.containsKey ('h2')",pc.getClass());
        //FIXME jthomas
        //q.setUnique(true);
        pc = (MappedByMapPC) q.getSingleResult();
        assertEquals(3, pc.getHelpers().size());
        assertEquals(h2, pc.getHelpers().get("h2"));
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.