com.j256.ormlite.stmt
Class RawResultsImpl<T>

java.lang.Object
  extended by com.j256.ormlite.stmt.RawResultsImpl<T>
All Implemented Interfaces:
CloseableIterable<T>, GenericRawResults<T>, Iterable<T>

public class RawResultsImpl<T>
extends Object
implements GenericRawResults<T>

Handler for our raw results objects which does the conversion for various different results: String[], Object[], and user defined .

Author:
graywatson

Field Summary
protected  String[] columnNames
           
protected  SelectIterator<T,Void> iterator
           
protected  GenericRowMapper<T> rowMapper
           
 
Constructor Summary
RawResultsImpl(ConnectionSource connectionSource, DatabaseConnection connection, String query, Class<?> clazz, CompiledStatement compiledStmt, String[] columnNames, GenericRowMapper<T> rowMapper)
           
 
Method Summary
 void close()
          Close any open database connections associated with the RawResults.
 String[] getColumnNames()
          Return the array of column names for each result row.
 int getNumberColumns()
          Return the number of columns in each result row.
 List<T> getResults()
          Return a list of all of the results.
 CloseableIterator<T> iterator()
          Returns an iterator over a set of elements of type T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowMapper

protected final GenericRowMapper<T> rowMapper

iterator

protected SelectIterator<T,Void> iterator

columnNames

protected final String[] columnNames
Constructor Detail

RawResultsImpl

public RawResultsImpl(ConnectionSource connectionSource,
                      DatabaseConnection connection,
                      String query,
                      Class<?> clazz,
                      CompiledStatement compiledStmt,
                      String[] columnNames,
                      GenericRowMapper<T> rowMapper)
               throws SQLException
Throws:
SQLException
Method Detail

getNumberColumns

public int getNumberColumns()
Description copied from interface: GenericRawResults
Return the number of columns in each result row.

Specified by:
getNumberColumns in interface GenericRawResults<T>

getColumnNames

public String[] getColumnNames()
Description copied from interface: GenericRawResults
Return the array of column names for each result row.

Specified by:
getColumnNames in interface GenericRawResults<T>

getResults

public List<T> getResults()
                   throws SQLException
Description copied from interface: GenericRawResults
Return a list of all of the results. For large queries, this should not be used since the CloseableIterable.iterator() method will allow your to process the results page-by-page.

Specified by:
getResults in interface GenericRawResults<T>
Throws:
SQLException

iterator

public CloseableIterator<T> iterator()
Description copied from interface: CloseableIterable
Returns an iterator over a set of elements of type T.

Specified by:
iterator in interface CloseableIterable<T>
Specified by:
iterator in interface Iterable<T>
Returns:
an CloseableIterator.

close

public void close()
           throws SQLException
Description copied from interface: GenericRawResults
Close any open database connections associated with the RawResults. This is only applicable if the Dao.iteratorRaw(String) or another iterator method was called.

Specified by:
close in interface GenericRawResults<T>
Throws:
SQLException


Copyright © 2011. All Rights Reserved.