Package org.jugile.util

Examples of org.jugile.util.Query


    return res;
  }
 
  private Query q = null;
  public Query q() {
    if (q == null) q = new Query();
    return q;
  }
View Full Code Here


    if (res.size() > 0) return res.get(0);
    return null;
  }
 
  public E unique() {
    Query q2 = q;
    if (size() > 1) {
      String querystr = "";
      try {
        if (q2 != null) querystr = q2.toString();
      } catch (Exception e) {}
      //Jugile.fail("Not unique $on : " + size() + " q: "+querystr);
      log.error("Not unique $on : " + size() + " q: "+querystr);
      return first("id");
    }
View Full Code Here

 
  // ----- sql interface -----
 
  public List<E> fromDb() { return fromDb(null); }
  public List<E> fromDb(String sql) {
    Query q2 = q();
    Bo bo = getProto();
    if (sql == null) sql = "where " + q2.toSql();
    sql = "select " + bo._getSelectFlds() +" from " + bo.table() + " " + sql;

    List<E> res = new ArrayList<E>();
    DBPool db = DBPool.getPool();
    DBConnection c = db.getConnection();
View Full Code Here

TOP

Related Classes of org.jugile.util.Query

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.