private void addNeedsFuture(NeedsFutureClause clause) { if (needsFuture != null) { throw new IllegalStateException( needsFuture + " is already waiting for a future clause, can't add: " + clause); } needsFuture = clause; push(clause); }
private void addClause(Clause clause) { if (needsFuture == null) { push(clause); } else { // we have a binary statement which was called before the right clause was defined needsFuture.setMissingClause(clause); needsFuture = null; } }
/** OR operation which takes the previous clause and the next clause and OR's them together. */ public Where<T, ID> or() { ManyClause clause = new ManyClause(pop("OR"), ManyClause.OR_OPERATION); push(clause); addNeedsFuture(clause); return this; }
/** AND operation which takes the previous clause and the next clause and AND's them together. */ public Where<T, ID> and() { ManyClause clause = new ManyClause(pop("AND"), ManyClause.AND_OPERATION); push(clause); addNeedsFuture(clause); return this; }