|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.skife.jdbi.v2.SQLStatement<Query<ResultType>>
org.skife.jdbi.v2.Query<ResultType>
public class Query<ResultType>
Statement prviding convenience result handling for SQL queries.
| Method Summary | ||
|---|---|---|
Query<ResultType> |
fetchForward()
Specify that the fetch order should be forward, uses the underlying Statement.setFetchDirection(int) |
|
Query<ResultType> |
fetchReverse()
Specify that the fetch order should be reversed, uses the underlying Statement.setFetchDirection(int) |
|
ResultType |
first()
Executes the select. |
|
|
fold(AccumulatorType accumulator,
Folder2<AccumulatorType> folder)
Used to execute the query and traverse the result set with a accumulator. |
|
ResultIterator<ResultType> |
iterator()
Obtain a forward-only result set iterator. |
|
List<ResultType> |
list()
Executes the select Will eagerly load all results |
|
List<ResultType> |
list(int maxRows)
Executes the select Will eagerly load all results up to a maximum of maxRows |
|
|
map(Class<Type> resultType)
Provide basic JavaBean mapping capabilities. |
|
|
map(ResultSetMapper<T> mapper)
|
|
|
mapTo(Class<T> resultType)
Makes use of registered mappers to map the result set to the desired type. |
|
void |
registerMapper(ResultSetMapper m)
|
|
void |
registerMapper(ResultSetMapperFactory m)
|
|
Query<ResultType> |
setFetchSize(int i)
Specify the fetch size for the query. |
|
Query<ResultType> |
setMaxFieldSize(int i)
Specify the maimum field size in the result set. |
|
Query<ResultType> |
setMaxRows(int i)
Specify the maimum number of rows the query is to return. |
|
| Methods inherited from class org.skife.jdbi.v2.SQLStatement |
|---|
addStatementCustomizer, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bindASCIIStream, bindASCIIStream, bindAsInt, bindAsInt, bindAsInt, bindAsInt, bindBinaryStream, bindBinaryStream, bindBySqlType, bindBySqlType, bindFromMap, bindFromProperties, bindNamedArgumentFinder, bindNull, bindNull, define, define, getConcreteContext, getConnection, getContext, getLog, getParameters, getParams, getRewriter, getSql, getStatementBuilder, getStatementCustomizers, getStatementLocator, getTimingCollector, internalExecute, setFetchDirection, setQueryTimeout, setStatementLocator, setStatementRewriter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Query<ResultType> fetchForward()
Statement.setFetchDirection(int)
public Query<ResultType> fetchReverse()
Statement.setFetchDirection(int)
public ResultType first()
public <AccumulatorType> AccumulatorType fold(AccumulatorType accumulator,
Folder2<AccumulatorType> folder)
accumulator - The initial accumulator valuefolder - Defines the function which will fold over the result set.
Folder.fold(Object, java.sql.ResultSet)Folderpublic ResultIterator<ResultType> iterator()
iterator in interface Iterable<ResultType>public List<ResultType> list()
UnableToCreateStatementException - if there is an error creating the statement
UnableToExecuteStatementException - if there is an error executing the statement
ResultSetException - if there is an error dealing with the result setpublic List<ResultType> list(int maxRows)
maxRows
maxRows - The maximum number of results to include in the result, any
rows in the result set beyond this number will be ignored.
UnableToCreateStatementException - if there is an error creating the statement
UnableToExecuteStatementException - if there is an error executing the statement
ResultSetException - if there is an error dealing with the result setpublic <Type> Query<Type> map(Class<Type> resultType)
resultType - JavaBean class to map result set fields into the properties of, by name
public <T> Query<T> map(ResultSetMapper<T> mapper)
public <T> Query<T> mapTo(Class<T> resultType)
resultType - the type to map the query results to
DBI.registerMapper(org.skife.jdbi.v2.tweak.ResultSetMapper),
DBI.registerMapper(ResultSetMapperFactory),
Handle.registerMapper(ResultSetMapperFactory),
Handle.registerMapper(org.skife.jdbi.v2.tweak.ResultSetMapper)public void registerMapper(ResultSetMapper m)
public void registerMapper(ResultSetMapperFactory m)
public Query<ResultType> setFetchSize(int i)
i - the number of rows to fetch in a bunch
public Query<ResultType> setMaxFieldSize(int i)
Statement.setMaxFieldSize(int)
i - maximum field size
public Query<ResultType> setMaxRows(int i)
Statement.setMaxRows(int)}.
i - maximum number of rows to return
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||