congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Expression.getSQL
Code IndexAdd Tabnine to your IDE (free)

How to use
getSQL
method
in
org.h2.expression.Expression

Best Java code snippets using org.h2.expression.Expression.getSQL (Showing top 20 results out of 315)

origin: com.h2database/h2

@Override
public String getSQL() {
  String sql = NAME + "(" + min.getSQL() + ", " + max.getSQL();
  if (step != null) {
    sql += ", " + step.getSQL();
  }
  return sql + ")";
}
origin: com.h2database/h2

/**
 * Convert this expression to a String.
 *
 * @return the string representation
 */
@Override
public String toString() {
  return getSQL();
}
origin: com.h2database/h2

@Override
public String getSQL() {
  String sql;
  if (regexp) {
    sql = left.getSQL() + " REGEXP " + right.getSQL();
  } else {
    sql = left.getSQL() + " LIKE " + right.getSQL();
    if (escape != null) {
      sql += " ESCAPE " + escape.getSQL();
    }
  }
  return "(" + sql + ")";
}
origin: com.h2database/h2

String getDefaultSQL() {
  return defaultExpression == null ? null : defaultExpression.getSQL();
}
origin: com.h2database/h2

@Override
public String getSQL() {
  return "(NOT " + condition.getSQL() + ")";
}
origin: com.h2database/h2

String getOnUpdateSQL() {
  return onUpdateExpression == null ? null : onUpdateExpression.getSQL();
}
origin: com.h2database/h2

@Override
public String getSQL() {
  String sql;
  switch (andOrType) {
  case AND:
    sql = left.getSQL() + "\n    AND " + right.getSQL();
    break;
  case OR:
    sql = left.getSQL() + "\n    OR " + right.getSQL();
    break;
  default:
    throw DbException.throwInternalError("andOrType=" + andOrType);
  }
  return "(" + sql + ")";
}
origin: com.h2database/h2

@Override
public String getSQL() {
  String sql;
  if (opType == OpType.NEGATE) {
    // don't remove the space, otherwise it might end up some thing like
    // --1 which is a line remark
    sql = "- " + left.getSQL();
  } else {
    // don't remove the space, otherwise it might end up some thing like
    // --1 which is a line remark
    sql = left.getSQL() + " " + getOperationToken() + " " + right.getSQL();
  }
  return "(" + sql + ")";
}
origin: com.h2database/h2

/**
 * Get the alias name of a column or SQL expression
 * if it is not an aliased expression.
 *
 * @return the alias name
 */
public String getAlias() {
  return StringUtils.unEnclose(getSQL());
}
origin: com.h2database/h2

/**
 * Get the check constraint SQL snippet.
 *
 * @param session the session
 * @param asColumnName the column name to use
 * @return the SQL snippet
 */
String getCheckConstraintSQL(Session session, String asColumnName) {
  Expression constraint = getCheckConstraint(session, asColumnName);
  return constraint == null ? "" : constraint.getSQL();
}
origin: com.h2database/h2

@Override
public String getSQL() {
  return expr.getSQL() + " AS " + Parser.quoteIdentifier(alias);
}
origin: com.h2database/h2

@Override
public String getSQL() {
  return '(' + left.getSQL() + " = ANY(" + parameter.getSQL() + "))";
}
origin: com.h2database/h2

private String getShortDescription() {
  return getName() + ": " + expr.getSQL();
}
origin: com.h2database/h2

private static void checkDefaultReferencesTable(Table table, Expression defaultExpression) {
  if (defaultExpression == null) {
    return;
  }
  HashSet<DbObject> dependencies = new HashSet<>();
  ExpressionVisitor visitor = ExpressionVisitor
      .getDependenciesVisitor(dependencies);
  defaultExpression.isEverything(visitor);
  if (dependencies.contains(table)) {
    throw DbException.get(ErrorCode.COLUMN_IS_REFERENCED_1,
        defaultExpression.getSQL());
  }
}
origin: com.h2database/h2

@Override
public String getSQL() {
  StatementBuilder buff = new StatementBuilder("(");
  buff.append(left.getSQL()).append(" IN(");
  for (Expression e : valueList) {
    buff.appendExceptFirst(", ");
    buff.append(e.getSQL());
  }
  return buff.append("))").toString();
}
origin: com.h2database/h2

@Override
public String getSQL() {
  StatementBuilder buff = new StatementBuilder("(");
  buff.append(left.getSQL()).append(" IN(");
  for (Expression e : valueList) {
    buff.appendExceptFirst(", ");
    buff.append(e.getSQL());
  }
  return buff.append("))").toString();
}
origin: com.h2database/h2

@Override
public String getSQL() {
  StatementBuilder buff = new StatementBuilder("(");
  for (Expression e: list) {
    buff.appendExceptFirst(", ");
    buff.append(e.getSQL());
  }
  if (list.length == 1) {
    buff.append(',');
  }
  return buff.append(')').toString();
}
origin: com.h2database/h2

@Override
public String getSQL() {
  StatementBuilder buff = new StatementBuilder();
  buff.append(Parser.quoteIdentifier(userAggregate.getName())).append('(');
  for (Expression e : args) {
    buff.appendExceptFirst(", ");
    buff.append(e.getSQL());
  }
  buff.append(')');
  if (filterCondition != null) {
    buff.append(" FILTER (WHERE ").append(filterCondition.getSQL()).append(')');
  }
  return buff.toString();
}
origin: com.h2database/h2

@Override
public void checkExistingData(Session session) {
  if (session.getDatabase().isStarting()) {
    // don't check at startup
    return;
  }
  String sql = "SELECT 1 FROM " + filter.getTable().getSQL() +
      " WHERE NOT(" + expr.getSQL() + ")";
  ResultInterface r = session.prepare(sql).query(1);
  if (r.next()) {
    throw DbException.get(ErrorCode.CHECK_CONSTRAINT_VIOLATED_1, getName());
  }
}
origin: com.h2database/h2

@Override
public String getSQL() {
  StatementBuilder buff = new StatementBuilder(getName());
  buff.append('(');
  int i = 0;
  for (Expression e : args) {
    buff.appendExceptFirst(", ");
    buff.append(columnList[i++].getCreateSQL()).append('=').append(e.getSQL());
  }
  return buff.append(')').toString();
}
org.h2.expressionExpressiongetSQL

Javadoc

Get the SQL statement of this expression. This may not always be the original SQL statement, specially after optimization.

Popular methods of Expression

  • getAlias
    Get the alias name of a column or SQL expression if it is not an aliased expression.
  • getDisplaySize
    Get the display size of this expression.
  • getNonAliasExpression
    Returns the main expression, skipping aliases.
  • getNotIfPossible
    If it is possible, return the negated expression. This is used to optimize NOT expressions: NOT ID>1
  • getPrecision
    Get the precision of this expression.
  • getScale
    Get the scale of this expression.
  • getType
    Return the data type. The data type may not be known before the optimization phase.
  • getValue
    Return the resulting value for the current row.
  • isConstant
    Check if this expression will always return the same value.
  • addFilterConditions
    Add conditions to a table filter if they can be evaluated.
  • createIndexConditions
    Create index conditions if possible and attach them to the table filter.
  • getBooleanValue
    Get the value in form of a boolean expression. Returns true or false. In this database, everything c
  • createIndexConditions,
  • getBooleanValue,
  • getColumnName,
  • getCost,
  • getNullable,
  • getSchemaName,
  • getTableAlias,
  • getTableName,
  • isAutoIncrement

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Path (java.nio.file)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now