Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.storage.sql.jdbc
Class ResultSetQueryResult

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.jdbc.ResultSetQueryResult
All Implemented Interfaces:
Iterable<Map<String,Serializable>>, Iterator<Map<String,Serializable>>, IterableQueryResult

public class ResultSetQueryResult
extends Object
implements IterableQueryResult, Iterator<Map<String,Serializable>>

Iterable query result implemented as a cursor on a SQL ResultSet.


Constructor Summary
ResultSetQueryResult(QueryMaker queryMaker, String query, QueryFilter queryFilter, Session.PathResolver pathResolver, JDBCMapper mapper, Object... params)
           
 
Method Summary
 void close()
          Closes the query result and releases the underlying resources held by the cursor.
 boolean hasNext()
           
 Iterator<Map<String,Serializable>> iterator()
           
 Map<String,Serializable> next()
           
 long pos()
          Gets the current position in the iterator.
 void remove()
           
 long size()
          Gets the total size of the query result.
 void skipTo(long pos)
          Skips to a given position in the iterator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetQueryResult

public ResultSetQueryResult(QueryMaker queryMaker,
                            String query,
                            QueryFilter queryFilter,
                            Session.PathResolver pathResolver,
                            JDBCMapper mapper,
                            Object... params)
                     throws StorageException,
                            SQLException
Throws:
StorageException
SQLException
Method Detail

close

public void close()
Description copied from interface: IterableQueryResult
Closes the query result and releases the underlying resources held by the cursor.

This MUST be called when the query result is no more needed, otherwise underlying resources will be leaked. There is no auto-closing at the end of the iteration.

Specified by:
close in interface IterableQueryResult

size

public long size()
Description copied from interface: IterableQueryResult
Gets the total size of the query result.

Note that this may be costly, and that some backends may not be able to do this operation, in which case -1 will be returned.

Specified by:
size in interface IterableQueryResult
Returns:
the size, or -1 for an unknown size

pos

public long pos()
Description copied from interface: IterableQueryResult
Gets the current position in the iterator.

Positions start at 0.

Specified by:
pos in interface IterableQueryResult
Returns:
the position

skipTo

public void skipTo(long pos)
Description copied from interface: IterableQueryResult
Skips to a given position in the iterator.

Positions start at 0.

Specified by:
skipTo in interface IterableQueryResult

iterator

public Iterator<Map<String,Serializable>> iterator()
Specified by:
iterator in interface Iterable<Map<String,Serializable>>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<Map<String,Serializable>>

next

public Map<String,Serializable> next()
Specified by:
next in interface Iterator<Map<String,Serializable>>

remove

public void remove()
Specified by:
remove in interface Iterator<Map<String,Serializable>>

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.