public <T extends Model> CriteriaContainer and(Criteria... criteria) { return q_.and(criteria); }
public CriteriaContainer and(Criteria... criteria) { return mq.and(criteria); }
@Override public List<play.db.Model> fetch(int offset, int size, String orderBy, String order, List<String> searchFields, String keywords, String where) { if (orderBy == null) orderBy = keyName(); if ("DESC".equalsIgnoreCase(order)) orderBy = null == orderBy ? null : "-" + orderBy; Query<? extends Model> q = ds().createQuery(clazz).offset(offset) .limit(size); if (null != orderBy) q = q.order(orderBy); if (keywords != null && !keywords.equals("")) { List<Criteria> cl = new ArrayList<Criteria>(); String[] sa = keywords.split("[\\W]+"); for (String f : fillSearchFieldsIfEmpty_(searchFields)) { List<Criteria> cl0 = new ArrayList<Criteria>(); for (String s : sa) { cl0.add(q.criteria(f).containsIgnoreCase(s)); } cl.add(q.and(cl0.toArray(new Criteria[]{}))); } q.or(cl.toArray(new Criteria[]{})); } processWhere(q, where); List<play.db.Model> l = new ArrayList<play.db.Model>(); l.addAll(q.asList()); return l; }