Пример #1
0
  /**
   * @param limit limit
   * @param offset offset
   * @param whereStatement where cause
   * @param args args
   * @return DataTable
   * @see com.tsc9526.monalisa.core.resources.HelpDoc#helpQuery(int,int,Example,String, Object...)
   */
  public DataTable<T> select(int limit, int offset, String whereStatement, Object... args) {
    Query query = model.dialect().select(model, whereStatement, args);
    query.use(db());

    DataTable<T> r = (DataTable<T>) query.getList(getResultCreator(query), limit, offset);
    return r;
  }
Пример #2
0
  /**
   * @param limit limit
   * @param offset offset
   * @param example Example
   * @return DataTable
   * @see com.tsc9526.monalisa.core.resources.HelpDoc#helpQuery(int,int,Example,String, Object...)
   */
  public DataTable<T> selectByExample(int limit, int offset, Example example) {
    Query w = QEH.getQuery(example);

    Query query = model.dialect().select(model, w.getSql(), w.getParameters());
    query.use(db());

    DataTable<T> r = (DataTable<T>) query.getList(getResultCreator(query), limit, offset);
    return r;
  }
Пример #3
0
  /**
   * @param whereStatement where cause
   * @param args args
   * @return DataTable
   * @see com.tsc9526.monalisa.core.resources.HelpDoc#helpQuery(int,int,Example,String, Object...)
   */
  public DataTable<T> select(String whereStatement, Object... args) {
    Query query = model.dialect().select(model, whereStatement, args);
    query.use(db());

    return (DataTable<T>) query.getList(getResultCreator(query));
  }