// Path: database/src/main/java/com/simple/database/crud/base/WhereBuilder.java
// public abstract class WhereBuilder<T> extends BaseSQLBuilder<T> {
//     protected String selection = null;
//     protected String[] selectionArgs = null;
// 
//     /**
//      * @param daoClass 同步的dao类,用于构建异步的dao类
//      */
//     public WhereBuilder(Class daoClass) {
//         super(daoClass);
//     }
// 
//     /**
//      * where 查询条件
//      *
//      * @param selection
//      * @param selectionArgs
//      * @return
//      */
//     public WhereBuilder where(String selection, String[] selectionArgs) {
//         this.selection = selection;
//         this.selectionArgs = selectionArgs;
//         return this;
//     }
// }
// 
// Path: database/src/main/java/com/simple/database/listeners/DbListener.java
// public interface DbListener<T> {
//     void onComplete(T result);
// }


import com.simple.database.crud.base.WhereBuilder;
import com.simple.database.listeners.DbListener;
import java.util.List;
        return this;
    }

    public QueryBuilder<T> limit(String limit) {
        this.limit = limit;
        return this;
    }

    /**
     * 返回的数据是 列表类型的Listener
     *
     * @param listener
     * @return
     */
    public QueryBuilder<T> listener(DbListener<List<T>> listener) {
        this.mDbListListener = listener;
        return this;
    }

    /**
     * 只需要单个数据
     */
    public void queryOne(final DbListener<T> listener) {
        mAsyncDao.query(selection, selectionArgs, orderBy, limit, new DbListener<List<T>>() {
            @Override
            public void onComplete(List<T> result) {
                if (result != null && result.size() > 0 && listener != null) {
                    listener.onComplete(result.get(0));
                }
            }
// Path: database/src/main/java/com/simple/database/crud/base/WhereBuilder.java
// public abstract class WhereBuilder<T> extends BaseSQLBuilder<T> {
//     protected String selection = null;
//     protected String[] selectionArgs = null;
// 
//     /**
//      * @param daoClass 同步的dao类,用于构建异步的dao类
//      */
//     public WhereBuilder(Class daoClass) {
//         super(daoClass);
//     }
// 
//     /**
//      * where 查询条件
//      *
//      * @param selection
//      * @param selectionArgs
//      * @return
//      */
//     public WhereBuilder where(String selection, String[] selectionArgs) {
//         this.selection = selection;
//         this.selectionArgs = selectionArgs;
//         return this;
//     }
// }
// 
// Path: database/src/main/java/com/simple/database/listeners/DbListener.java
// public interface DbListener<T> {
//     void onComplete(T result);
// }


// Path: database/src/main/java/com/simple/database/crud/QueryBuilder.java
import com.simple.database.crud.base.WhereBuilder;
import com.simple.database.listeners.DbListener;
import java.util.List;

        return this;
    }

    public QueryBuilder<T> limit(String limit) {
        this.limit = limit;
        return this;
    }

    /**
     * 返回的数据是 列表类型的Listener
     *
     * @param listener
     * @return
     */
    public QueryBuilder<T> listener(DbListener<List<T>> listener) {
        this.mDbListListener = listener;
        return this;
    }

    /**
     * 只需要单个数据
     */
    public void queryOne(final DbListener<T> listener) {
        mAsyncDao.query(selection, selectionArgs, orderBy, limit, new DbListener<List<T>>() {
            @Override
            public void onComplete(List<T> result) {
                if (result != null && result.size() > 0 && listener != null) {
                    listener.onComplete(result.get(0));
                }
            }
        });