Tabnine Logo
RenderContext.keyword
Code IndexAdd Tabnine 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)

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

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JComboBox (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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