public static final class QuerySelect.Builder extends Object
QuerySelect
.Constructor and Description |
---|
QuerySelect.Builder(String sql,
Database db)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> rx.Observable<T> |
autoMap(Class<T> cls)
Transforms each row of the
ResultSet into an instance of
T using automapping of the ResultSet columns into
corresponding constructor parameters that are assignable. |
rx.Observable<Integer> |
count() |
QuerySelect.Builder |
dependsOn(rx.Observable<?> dependency)
Appends a dependency to the dependencies that have to complete their
emitting before the query is executed.
|
QuerySelect.Builder |
dependsOnLastTransaction()
Appends a dependency on the result of the last transaction (
true for commit or false for rollback) to
the dependencies that have to complete their emitting before the
query is executed. |
QuerySelect.OperatorBuilder<Object> |
dependsOnOperator()
Returns an
Observable.Operator to allow the query to be pushed
dependencies via the Observable.lift(Operator) method. |
<T> rx.Observable<T> |
get(ResultSetMapper<? extends T> function)
Transforms the results using the given function.
|
<S> rx.Observable<S> |
getAs(Class<S> cls)
Automaps the first column of the ResultSet into the target class
cls . |
<T1,T2> rx.Observable<Tuple2<T1,T2>> |
getAs(Class<T1> cls1,
Class<T2> cls2)
Automaps the columns of the
ResultSet into the specified
classes. |
<T1,T2,T3> rx.Observable<Tuple3<T1,T2,T3>> |
getAs(Class<T1> cls1,
Class<T2> cls2,
Class<T3> cls3)
Automaps the columns of the
ResultSet into the specified
classes. |
<T1,T2,T3,T4> |
getAs(Class<T1> cls1,
Class<T2> cls2,
Class<T3> cls3,
Class<T4> cls4)
Automaps the columns of the
ResultSet into the specified
classes. |
<T1,T2,T3,T4,T5> |
getAs(Class<T1> cls1,
Class<T2> cls2,
Class<T3> cls3,
Class<T4> cls4,
Class<T5> cls5)
Automaps the columns of the
ResultSet into the specified
classes. |
<T1,T2,T3,T4,T5,T6> |
getAs(Class<T1> cls1,
Class<T2> cls2,
Class<T3> cls3,
Class<T4> cls4,
Class<T5> cls5,
Class<T6> cls6)
Automaps the columns of the
ResultSet into the specified
classes. |
<T1,T2,T3,T4,T5,T6,T7> |
getAs(Class<T1> cls1,
Class<T2> cls2,
Class<T3> cls3,
Class<T4> cls4,
Class<T5> cls5,
Class<T6> cls6,
Class<T7> cls7)
Automaps the columns of the
ResultSet into the specified
classes. |
<S> rx.Observable<TupleN<Object>> |
getTupleN()
|
<S> rx.Observable<TupleN<S>> |
getTupleN(Class<S> cls)
Automaps all the columns of the
ResultSet into the target
class cls . |
QuerySelect.Builder |
parameter(Object value)
Appends a parameter to the parameter list for the query.
|
QuerySelect.Builder |
parameter(String name,
Object value)
Sets a named parameter.
|
QuerySelect.OperatorBuilder<rx.Observable<Object>> |
parameterListOperator()
Returns an
Observable.Operator that runs a select query for each list of
parameter objects in the source observable. |
QuerySelect.OperatorBuilder<Object> |
parameterOperator()
Returns an
Observable.Operator to allow the query to be pushed
parameters via the Observable.lift(Operator) method. |
QuerySelect.Builder |
parameters(Object... objects)
Appends the given parameter values to the parameter list for the
query.
|
<T> QuerySelect.Builder |
parameters(rx.Observable<T> parameters)
Appends the given parameters to the parameter list for the query.
|
public <T> QuerySelect.Builder parameters(rx.Observable<T> parameters)
parameters
- public QuerySelect.Builder parameters(Object... objects)
objects
- public QuerySelect.Builder parameter(Object value)
value
- public QuerySelect.Builder parameter(String name, Object value)
NullPointerException
. If value is instance of Observable then
throws an IllegalArgumentException
.name
- the parameter name. Cannot be null.value
- the parameter valuepublic QuerySelect.Builder dependsOn(rx.Observable<?> dependency)
dependency
- public QuerySelect.Builder dependsOnLastTransaction()
true
for commit or false
for rollback) to
the dependencies that have to complete their emitting before the
query is executed.public <T> rx.Observable<T> get(ResultSetMapper<? extends T> function)
function
- public <T> rx.Observable<T> autoMap(Class<T> cls)
Transforms each row of the ResultSet
into an instance of
T
using automapping of the ResultSet columns into
corresponding constructor parameters that are assignable. Beyond
normal assignable criteria (for example Integer 123 is assignable to
a Double) other conversions exist to facilitate the automapping:
They are:
cls
- public <S> rx.Observable<S> getAs(Class<S> cls)
cls
.cls
- public <T1,T2> rx.Observable<Tuple2<T1,T2>> getAs(Class<T1> cls1, Class<T2> cls2)
cls1
- cls2
- public <T1,T2,T3> rx.Observable<Tuple3<T1,T2,T3>> getAs(Class<T1> cls1, Class<T2> cls2, Class<T3> cls3)
cls1
- cls2
- cls3
- public <T1,T2,T3,T4> rx.Observable<Tuple4<T1,T2,T3,T4>> getAs(Class<T1> cls1, Class<T2> cls2, Class<T3> cls3, Class<T4> cls4)
cls1
- cls2
- cls3
- cls4
- public <T1,T2,T3,T4,T5> rx.Observable<Tuple5<T1,T2,T3,T4,T5>> getAs(Class<T1> cls1, Class<T2> cls2, Class<T3> cls3, Class<T4> cls4, Class<T5> cls5)
cls1
- cls2
- cls3
- cls4
- cls5
- public <T1,T2,T3,T4,T5,T6> rx.Observable<Tuple6<T1,T2,T3,T4,T5,T6>> getAs(Class<T1> cls1, Class<T2> cls2, Class<T3> cls3, Class<T4> cls4, Class<T5> cls5, Class<T6> cls6)
cls1
- cls2
- cls3
- cls4
- cls5
- cls6
- public <T1,T2,T3,T4,T5,T6,T7> rx.Observable<Tuple7<T1,T2,T3,T4,T5,T6,T7>> getAs(Class<T1> cls1, Class<T2> cls2, Class<T3> cls3, Class<T4> cls4, Class<T5> cls5, Class<T6> cls6, Class<T7> cls7)
cls1
- cls2
- cls3
- cls4
- cls5
- cls6
- cls7
- public rx.Observable<Integer> count()
public QuerySelect.OperatorBuilder<Object> parameterOperator()
Observable.Operator
to allow the query to be pushed
parameters via the Observable.lift(Operator)
method.public QuerySelect.OperatorBuilder<Object> dependsOnOperator()
Observable.Operator
to allow the query to be pushed
dependencies via the Observable.lift(Operator)
method.public QuerySelect.OperatorBuilder<rx.Observable<Object>> parameterListOperator()
Observable.Operator
that runs a select query for each list of
parameter objects in the source observable.Copyright © 2014–2015. All rights reserved.