All Downloads are FREE. Search and download functionalities are using the official Maven repository.

studio.raptor.sqlparser.fast.expression.ConditionNot Maven / Gradle / Ivy

/*
 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
 * and the EPL 1.0 (http://h2database.com/html/license.html).
 * Initial Developer: H2 Group
 */
package studio.raptor.sqlparser.fast.expression;

import studio.raptor.sqlparser.fast.table.ColumnResolver;
import studio.raptor.sqlparser.fast.value.Value;

/**
 * A NOT condition.
 */
public class ConditionNot extends Condition {

  private Expression condition;

  public ConditionNot(Expression condition) {
    this.condition = condition;
  }

  @Override
  public Value getValue() {
    return null;
  }

  @Override
  public void mapColumns(ColumnResolver resolver, int level) {
    condition.mapColumns(resolver, level);
  }

  @Override
  public Expression optimize() {
    return this;
  }

  @Override
  public String getSQL() {
    return "(NOT " + condition.getSQL() + ")";
  }

  @Override
  public boolean isEverything(ExpressionVisitor visitor) {
    return condition.isEverything(visitor);
  }

  @Override
  public int getType() {
    return 0;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy