// Path: rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/exceptions/QueryAnnotationMissingException.java
// public final class QueryAnnotationMissingException extends SQLRuntimeException {
// 
//     private static final long serialVersionUID = 6725264065633977594L;
// 
//     public QueryAnnotationMissingException(String message) {
//         super(message);
//     }
// }


import java.sql.Connection;
import java.util.List;
import javax.annotation.Nonnull;
import org.davidmoten.rx.jdbc.annotations.Query;
import org.davidmoten.rx.jdbc.exceptions.QueryAnnotationMissingException;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.functions.Function;
package org.davidmoten.rx.jdbc;





public final class SelectAutomappedBuilder<T> {

    final SelectBuilder selectBuilder;

    final Class<T> cls;

    private final Database db;

    SelectAutomappedBuilder(Class<T> cls, Single<Connection> connections, Database db) {
        this.selectBuilder = new SelectBuilder(getSql(cls), connections, db);
        this.cls = cls;
        this.db = db;
    }

    private static String getSql(Class<?> cls) {
        Query q = cls.getDeclaredAnnotation(Query.class);
        if (q == null) {
// Path: rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/exceptions/QueryAnnotationMissingException.java
// public final class QueryAnnotationMissingException extends SQLRuntimeException {
// 
//     private static final long serialVersionUID = 6725264065633977594L;
// 
//     public QueryAnnotationMissingException(String message) {
//         super(message);
//     }
// }


// Path: rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/SelectAutomappedBuilder.java
import java.sql.Connection;
import java.util.List;
import javax.annotation.Nonnull;
import org.davidmoten.rx.jdbc.annotations.Query;
import org.davidmoten.rx.jdbc.exceptions.QueryAnnotationMissingException;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.functions.Function;

package org.davidmoten.rx.jdbc;





public final class SelectAutomappedBuilder<T> {

    final SelectBuilder selectBuilder;

    final Class<T> cls;

    private final Database db;

    SelectAutomappedBuilder(Class<T> cls, Single<Connection> connections, Database db) {
        this.selectBuilder = new SelectBuilder(getSql(cls), connections, db);
        this.cls = cls;
        this.db = db;
    }

    private static String getSql(Class<?> cls) {
        Query q = cls.getDeclaredAnnotation(Query.class);
        if (q == null) {
            throw new QueryAnnotationMissingException(