Package org.apache.openjpa.lib.rop

Examples of org.apache.openjpa.lib.rop.ResultList


        // now that we've executed the query, we can call isAggregate and
        // hasGrouping efficiently
        boolean detach = (_broker.getAutoDetach() &
            AutoDetach.DETACH_NONTXREAD) > 0 && !_broker.isActive();
        boolean lrs = range.lrs && !ex.isAggregate(q) && !ex.hasGrouping(q);
        ResultList res = (!detach && lrs) ? _fc.newResultList(rop)
            : new EagerResultList(rop);

        _resultLists.add(decorateResultList(res));
        return res;
    }
View Full Code Here


   
    public void testRoundtrip() {
        List<String> list = new ArrayList<String>();
        list.add("xxx");
        list.add("yyy");
        ResultList resultList = new ListResultList(list);
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        em.close();
        RuntimeExceptionTranslator trans = PersistenceExceptions.getRollbackTranslator(em);
        DistinctResultList distinctResultList = new DistinctResultList(resultList, trans);
        try {
View Full Code Here

   
    public void testRoundtrip() {
        List<String> list = new ArrayList<String>();
        list.add("xxx");
        list.add("yyy");
        ResultList resultList = new ListResultList(list);
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();
        em.close();
        RuntimeExceptionTranslator trans = PersistenceExceptions.getRollbackTranslator(em);
        DistinctResultList distinctResultList = new DistinctResultList(resultList, trans);
        try {
View Full Code Here

       
        Query headerQuery = em.createNativeQuery("SELECT MESSAGE_ID, HEADERS_ID FROM MESSAGE_HEADER");
        em.getTransaction().commit();
       
        DelegatingResultList headerNameList = (DelegatingResultList) headerQuery.getResultList();
        ResultList rl = headerNameList.getDelegate();
        for (int i=0; i < rl.size(); i++) {
            Object[] results = (Object[]) rl.get(i);
            Long messageId = (Long) results[0];
            Long headerId = (Long) results[1];
            em.getTransaction().begin();
            Query update = em.createNativeQuery("UPDATE HEADER SET MESSAGE_ID = ? WHERE ID = ?");
            update.setParameter(1, messageId);
View Full Code Here

        Query propertyQuery = em.createNativeQuery("SELECT MESSAGE_ID, PROPERTIES_ID FROM MESSAGE_PROPERTY");
        em.getTransaction().commit();

        DelegatingResultList propertyNameList = (DelegatingResultList) propertyQuery.getResultList();
        ResultList rl = propertyNameList.getDelegate();
        for (int i=0; i < rl.size(); i++) {
            Object[] results = (Object[]) rl.get(i);
            Long messageId = (Long) results[0];
            Long propertyId = (Long) results[1];
            em.getTransaction().begin();
            Query update = em.createNativeQuery("UPDATE PROPERTY SET MESSAGE_ID = ? WHERE ID = ?");
            update.setParameter(1, messageId);
View Full Code Here

        + "ORDER BY INTFIELD");
        ResultSetResult res = new ResultSetResult(rs,
        store.getConfiguration().getDBDictionaryInstance());
        ResultObjectProvider rop = new GenericResultObjectProvider
        (RawSQL.class, store, null, res);
        ResultList rl = new EagerResultList(rop);
        check(rl, broker);
        rl.close();
        broker.close();
        em.close();
    }
View Full Code Here

                // note that we're not loading version info here, so the system
                // will go out and get it after this intial load; kinda neat
            }
        };
        ResultList rl = new EagerResultList(rop);
        check(rl, broker);
        rl.close();
        broker.close();
    }
View Full Code Here

        // now that we've executed the query, we can call isAggregate and
        // hasGrouping efficiently
        boolean detach = (_broker.getAutoDetach() &
            AutoDetach.DETACH_NONTXREAD) > 0 && !_broker.isActive();
        boolean lrs = range.lrs && !ex.isAggregate(q) && !ex.hasGrouping(q);
        ResultList res = (!detach && lrs) ? _fc.newResultList(rop)
            : new EagerResultList(rop);

        _resultLists.add(decorateResultList(res));
        return res;
    }
View Full Code Here

        // now that we've executed the query, we can call isAggregate and
        // hasGrouping efficiently
        boolean detach = (_broker.getAutoDetach() &
            AutoDetach.DETACH_NONTXREAD) > 0 && !_broker.isActive();
        boolean lrs = range.lrs && !ex.isAggregate(q) && !ex.hasGrouping(q);
        ResultList res = (!detach && lrs) ? _fc.newResultList(rop)
            : new EagerResultList(rop);

        _resultLists.add(decorateResultList(res));
        return res;
    }
View Full Code Here

        + "ORDER BY INTFIELD");
        ResultSetResult res = new ResultSetResult(rs,
        store.getConfiguration().getDBDictionaryInstance());
        ResultObjectProvider rop = new GenericResultObjectProvider
        (RawSQL.class, store, null, res);
        ResultList rl = new EagerResultList(rop);
        check(rl, broker);
        rl.close();
        broker.close();
        em.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.rop.ResultList

Copyright © 2018 www.massapicom. 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.