Example #1
0
 /**
  * Ensures that all specified expressions are vacuous or either updating or non-updating.
  * Otherwise, throws an exception.
  *
  * @param exprs expressions to be checked
  * @throws QueryException query exception
  */
 void checkAllUp(final Expr... exprs) throws QueryException {
   // updating state: 0 = initial state, 1 = updating, -1 = non-updating
   int s = 0;
   for (final Expr expr : exprs) {
     expr.checkUp();
     if (expr.isVacuous()) continue;
     final boolean u = expr.has(Flag.UPD);
     if (u && s == -1 || !u && s == 1) throw UPALL.get(info, description());
     s = u ? 1 : -1;
   }
 }
Example #2
0
 /**
  * Ensures that the specified expression performs no updates. Otherwise, throws an exception.
  *
  * @param expr expression (may be {@code null})
  * @throws QueryException query exception
  */
 protected void checkNoUp(final Expr expr) throws QueryException {
   if (expr == null) return;
   expr.checkUp();
   if (expr.has(Flag.UPD)) throw UPNOT_X.get(info, description());
 }