Codota Logo
RenderContext.keyword
Code IndexAdd Codota to your IDE (free)

How to use
keyword
method
in
org.jooq.RenderContext

Best Java code snippets using org.jooq.RenderContext.keyword (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext ctx) {
  ctx.keyword(keyword);
}
origin: palantir/atlasdb

TableLike<?> values(DSLContext ctx, RowN[] rows, String tableName, String... fieldNames) {
  switch (sqlDialect.family()) {
  case H2:
    List<SelectField<?>> fields = Lists.newArrayListWithCapacity(fieldNames.length);
    for (int i = 1; i <= fieldNames.length; i++) {
      fields.add(DSL.field("C" + i).as(fieldNames[i-1]));
    }
    RenderContext context = ctx.renderContext();
    context.start(TABLE_VALUES)
      .keyword("values")
      .formatIndentLockStart();
    boolean firstRow = true;
    for (Row row : rows) {
      if (!firstRow) {
        context.sql(',').formatSeparator();
      }
      context.sql(row.toString());
      firstRow = false;
    }
    context.formatIndentLockEnd()
      .end(TABLE_VALUES);
    String valuesClause = context.render();
    return ctx.select(fields).from(valuesClause).asTable(tableName);
  default:
    return DSL.values(rows).as(tableName, fieldNames);
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  context.visit(row)
      .sql(" ")
      .keyword(isNull ? "is null" : "is not null");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext ctx) {
  ctx.keyword("lateral")
    .sql(" ")
    .visit(table);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

static void toSQLAs(RenderContext context) {
  if (asList(DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES).contains(context.configuration().dialect())) {
    context.sql(" ").keyword("as");
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  context.keyword("not(").visit(condition).sql(")");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  context.visit(field).sql(" ").keyword(isNull ? "is null" : "is not null");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Render <code>KEEP (DENSE_RANK [FIRST | LAST] ORDER BY {...})</code> clause
 */
private void toSQLKeepDenseRankOrderByClause(RenderContext ctx) {
  if (!keepDenseRankOrderBy.isEmpty()) {
    ctx.sql(" ").keyword("keep")
      .sql(" (").keyword("dense_rank")
      .sql(" ").keyword(first ? "first" : "last")
      .sql(" ").keyword("order by")
      .sql(" ").visit(keepDenseRankOrderBy)
      .sql(")");
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

  @Override
  public void toSQL(RenderContext context) {
    context.sql("(").keyword("select").sql(" * ")
        .keyword("from").sql(" ").keyword("unnest").sql("(").visit(array).sql(") ")
        .keyword("as").sql(" ").literal(alias)
        .sql("(").literal("COLUMN_VALUE").sql("))");
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Render <code>WITHIN GROUP (ORDER BY ..)</code> clause
 */
private final void toSQLWithinGroupClause(RenderContext ctx) {
  if (!withinGroupOrderBy.isEmpty()) {
    ctx.sql(" ").keyword("within group")
      .sql(" (").keyword("order by")
      .sql(" ").visit(withinGroupOrderBy)
      .sql(")");
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

  @Override
  public void toSQL(RenderContext context) {
    context.keyword("table(").sql("COLUMN_VALUE ");
    // If the array type is unknown (e.g. because it's returned from
    // a stored function
    // Then the best choice for arbitrary types is varchar
    if (array.getDataType().getType() == Object[].class) {
      context.keyword(H2DataType.VARCHAR.getTypeName());
    }
    else {
      context.keyword(array.getDataType().getTypeName());
    }
    context.sql(" = ").visit(array).sql(")");
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  for (int i = 0; i < queries.size(); i++) {
    if (i != 0) {
      context.formatSeparator()
          .keyword(operator.toSQL(context.configuration().dialect()))
          .formatSeparator();
    }
    wrappingParenthesis(context, "(");
    context.visit(queries.get(i));
    wrappingParenthesis(context, ")");
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  context.visit(delegate)
      .sql(" ").keyword("with")
      .sql(" (").sql(hint)
      .sql(")");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

private final void toSQLCast(RenderContext context, DataType<?> type, int length, int precision, int scale) {
  context.keyword("cast").sql("(");
  toSQL(context, value, getType());
  context.sql(" ").keyword("as").sql(" ")
      .sql(type.length(length).precision(precision, scale).getCastTypeName(context.configuration()))
      .sql(")");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  context.visit(field)
      .sql(" ")
      .keyword(comparator.toSQL())
      .sql(" ")
      .visit(query);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  context.visit(left)
      .sql(" ")
      .keyword(comparator.toSQL())
      .sql(" (")
      .visit(right)
      .sql(")");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  switch (context.configuration().dialect()) {
    case HSQLDB: {
      context.keyword("table(").visit(function).sql(")");
      break;
    }
    default:
      throw new SQLDialectNotSupportedException("FUNCTION TABLE is not supported for " + context.configuration().dialect());
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

final void toSQLReturning(RenderContext context) {
  if (!returning.isEmpty()) {
    switch (context.configuration().dialect()) {
      case FIREBIRD:
      case POSTGRES:
        context.formatSeparator()
            .keyword("returning")
            .sql(" ")
            .visit(returning);
        break;
      default:
        // Other dialects don't render a RETURNING clause, but
        // use JDBC's Statement.RETURN_GENERATED_KEYS mode instead
        break;
    }
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

private final void toSQLOverClause(RenderContext ctx) {
  QueryPart window = window(ctx);
  // Render this clause only if needed
  if (window == null)
    return;
  // [#1524] Don't render this clause where it is not supported
  if (term == ROW_NUMBER && ctx.configuration().dialect() == HSQLDB)
    return;
  ctx.sql(" ")
    .keyword("over")
    .sql(" (")
    .visit(window)
    .sql(")");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  // Some databases need extra parentheses around the RHS
  boolean extraParentheses = asList().contains(context.configuration().dialect().family());
  boolean subquery = context.subquery();
  context.visit(left)
      .sql(" ")
      .keyword(comparator.toSQL())
      .sql(" (")
      .sql(extraParentheses ? "(" : "");
  context.data(DATA_ROW_VALUE_EXPRESSION_PREDICATE_SUBQUERY, true);
  context.subquery(true)
      .visit(right)
      .subquery(subquery);
  context.data(DATA_ROW_VALUE_EXPRESSION_PREDICATE_SUBQUERY, null);
  context.sql(extraParentheses ? ")" : "")
      .sql(")");
}
org.jooqRenderContextkeyword

Javadoc

Append a SQL keyword to the context's contained StringBuilder.

Use this to have your SQL keyword rendered in RenderKeywordStyle(upper or lower case)

Popular methods of RenderContext

  • sql
    Recurse rendering.
  • visit
  • render
    Render a query part in a new context derived from this one. The rendered SQL will not be appended to
  • declareTables
  • paramType
    Set the new context value for #paramType().
  • castMode
    Set the new cast mode for #castMode().
  • configuration
  • data
  • declareFields
  • declareWindows
  • end
  • formatIndentEnd
    Stop indenting subsequent SQL by a number of characters, if Settings#isRenderFormatted() is set to t
  • end,
  • formatIndentEnd,
  • formatIndentLockEnd,
  • formatIndentLockStart,
  • formatIndentStart,
  • formatNewLine,
  • formatSeparator,
  • literal,
  • nextAlias

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now