Search in sources :

Example 6 with QueryResult

use of org.datanucleus.store.query.QueryResult in project datanucleus-core by datanucleus.

the class DefaultCandidateExtent method iterator.

public Iterator<T> iterator() {
    Object results = query.execute();
    Iterator iter = null;
    if (results instanceof QueryResult) {
        QueryResult qr = (QueryResult) results;
        iter = qr.iterator();
        queryResultsByIterator.put(iter, qr);
    } else {
        iter = ((Collection) results).iterator();
    }
    return iter;
}
Also used : QueryResult(org.datanucleus.store.query.QueryResult) Iterator(java.util.Iterator)

Aggregations

QueryResult (org.datanucleus.store.query.QueryResult)6 SQLException (java.sql.SQLException)5 ManagedConnection (org.datanucleus.store.connection.ManagedConnection)5 ResultSet (java.sql.ResultSet)4 Iterator (java.util.Iterator)4 NucleusDataStoreException (org.datanucleus.exceptions.NucleusDataStoreException)4 ManagedConnectionResourceListener (org.datanucleus.store.connection.ManagedConnectionResourceListener)4 PreparedStatement (java.sql.PreparedStatement)3 QueryInterruptedException (org.datanucleus.store.query.QueryInterruptedException)3 RDBMSStoreManager (org.datanucleus.store.rdbms.RDBMSStoreManager)3 SQLController (org.datanucleus.store.rdbms.SQLController)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 NucleusException (org.datanucleus.exceptions.NucleusException)2 NucleusUserException (org.datanucleus.exceptions.NucleusUserException)2 AbstractClassMetaData (org.datanucleus.metadata.AbstractClassMetaData)2 CandidateIdsQueryResult (org.datanucleus.store.query.CandidateIdsQueryResult)2 QueryTimeoutException (org.datanucleus.store.query.QueryTimeoutException)2