Пример #1
0
  /**
   * Tests if the specified expressions are updating or vacuous.
   *
   * @param ctx query context
   * @param expr expression array
   * @throws QueryException query exception
   */
  public void checkUp(final QueryContext ctx, final Expr... expr) throws QueryException {

    if (!ctx.updating) return;
    int s = 0;
    for (final Expr e : expr) {
      if (e.vacuous()) continue;
      final boolean u = e.uses(Use.UPD);
      if (u && s == 2 || !u && s == 1) UPNOT.thrw(input, desc());
      s = u ? 1 : 2;
    }
  }
Пример #2
0
 /**
  * Checks if the specified expressions is no updating expression.
  *
  * @param e expression
  * @param ctx query context
  * @return the specified expression
  * @throws QueryException query exception
  */
 public final Expr checkUp(final Expr e, final QueryContext ctx) throws QueryException {
   if (e != null && ctx.updating && e.uses(Use.UPD)) UPNOT.thrw(input, desc());
   return e;
 }