Esempio n. 1
0
  Expression(ExpressionOperator operator, Field<T> lhs, Field<?>... rhs) {
    super(operator.toSQL(), lhs.getDataType(), Util.combine(lhs, rhs));

    this.operator = operator;
    this.lhs = lhs;
    this.rhs = new FieldList();
    this.rhs.addAll(Arrays.asList(rhs));
  }
Esempio n. 2
0
  @Override
  public final void accept(Context<?> ctx) {
    SQLDialect family = ctx.configuration().dialect().family();

    if (operator == BIT_NOT && asList(H2, HSQLDB).contains(family)) {
      ctx.sql("(0 - ").visit(field).sql(" - 1)");
    } else if (operator == BIT_NOT && family == FIREBIRD) {
      ctx.keyword("bin_not(").visit(field).sql(')');
    } else {
      ctx.sql(operator.toSQL()).sql('(').visit(field).sql(')');
    }
  }
Esempio n. 3
0
  Neg(Field<T> field, ExpressionOperator operator) {
    super(operator.toSQL() + field.getName(), field.getDataType());

    this.operator = operator;
    this.field = field;
  }