NOTE: You must call {@link CloseableIterator#close()} method when you are done otherwise the underlying SQLstatement and connection may be kept open.
280281282283284285286287
/** * Add a 'IS NULL' clause so the column must be null. '=' NULL does not work. */ public Where<T, ID> isNull(String columnName) throws SQLException { addClause(new IsNull(columnName, findColumnFieldType(columnName))); return this; }
143144145146147148149150
/** * AND operation which takes the previous clause and the next clause and AND's them together. */ public Where<T, ID> and() { addNeedsFuture(new ManyClause(pop("AND"), ManyClause.AND_OPERATION)); return this; }
161162163164165166167168
*/ public Where<T, ID> and(Where<T, ID> first, Where<T, ID> second, Where<T, ID>... others) { Clause[] clauses = buildClauseArray(others, "AND"); Clause secondClause = pop("AND"); Clause firstClause = pop("AND"); addClause(new ManyClause(firstClause, secondClause, clauses, ManyClause.AND_OPERATION)); return this; }
182183184185186187188189
} Clause[] clauses = new Clause[numClauses]; for (int i = numClauses - 1; i >= 0; i--) { clauses[i] = pop("AND"); } addClause(new ManyClause(clauses, ManyClause.AND_OPERATION)); return this; }
348349350351352353354355
/** * OR operation which takes the previous clause and the next clause and OR's them together. */ public Where<T, ID> or() { addNeedsFuture(new ManyClause(pop("OR"), ManyClause.OR_OPERATION)); return this; }
366367368369370371372373
*/ public Where<T, ID> or(Where<T, ID> left, Where<T, ID> right, Where<T, ID>... others) { Clause[] clauses = buildClauseArray(others, "OR"); Clause secondClause = pop("OR"); Clause firstClause = pop("OR"); addClause(new ManyClause(firstClause, secondClause, clauses, ManyClause.OR_OPERATION)); return this; }
387388389390391392393394
} Clause[] clauses = new Clause[numClauses]; for (int i = numClauses - 1; i >= 0; i--) { clauses[i] = pop("OR"); } addClause(new ManyClause(clauses, ManyClause.OR_OPERATION)); return this; }
332333334335336337338339
/** * Used to NOT the next clause specified. */ public Where<T, ID> not() { addNeedsFuture(new Not()); return this; }
340341342343344345346347
/** * Used to NOT the argument clause specified. */ public Where<T, ID> not(Where<T, ID> comparison) { addClause(new Not(pop("NOT"))); return this; }
141142143144145146147148
throw new IllegalArgumentException("Can't orderBy foreign colletion field: " + columnName); } if (orderByList == null) { orderByList = new ArrayList<OrderBy>(); } orderByList.add(new OrderBy(columnName, ascending)); return this; }