com.github.davidmoten.rx.jdbc.QuerySelectOperator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxjava-jdbc Show documentation
Show all versions of rxjava-jdbc Show documentation
rx-java Observables for jdbc
package com.github.davidmoten.rx.jdbc;
import static com.github.davidmoten.rx.OperationToOperator.toOperator;
import java.sql.ResultSet;
import rx.Observable;
import rx.Observable.Operator;
import rx.Subscriber;
import rx.functions.Func1;
/**
* Operator corresponding to the QuerySelectOperation.
*
* @param
*/
final class QuerySelectOperator implements Operator {
private final Operator operator;
/**
* Constructor.
*
* @param builder
* @param function
* @param operatorType
*/
QuerySelectOperator(final QuerySelect.Builder builder,
final Func1 function, final OperatorType operatorType) {
operator = toOperator(new Func1, Observable>() {
@Override
public Observable call(Observable observable) {
if (operatorType == OperatorType.PARAMETER)
return builder.parameters(observable).get(function);
else if (operatorType == OperatorType.DEPENDENCY)
// dependency
return builder.dependsOn(observable).get(function);
else // PARAMETER_LIST
{
@SuppressWarnings("unchecked")
Observable> obs = (Observable>) observable;
return obs
.concatMap(new Func1, Observable>() {
@Override
public Observable call(
Observable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy