congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
RenderContext.formatSeparator
Code IndexAdd Tabnine to your IDE (free)

How to use
formatSeparator
method
in
org.jooq.RenderContext

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

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) {
  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

context.formatSeparator();
origin: com.ning.billing/killbill-osgi-bundles-analytics

context.formatSeparator()
    .keyword("or")
    .sql(" ");
context.formatSeparator()
    .keyword("and")
    .sql(" ");
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

context.formatSeparator()
    .start(INSERT_VALUES)
    .keyword("values")
    context.formatSeparator()
        .start(INSERT_SELECT);
    context.visit(insertSelect(context));
    context.formatSeparator()
        .start(INSERT_VALUES)
        .keyword("values")
origin: com.ning.billing/killbill-osgi-bundles-analytics

context.formatSeparator()
    .keyword(restartIdentity ? "restart identity" : "continue identity");
context.formatSeparator()
    .keyword(cascade ? "cascade" : "restrict");
origin: com.ning.billing/killbill-osgi-bundles-analytics

  .formatSeparator()
  .start(translatedClause)
  .keyword(keyword)
context.formatSeparator()
    .start(TABLE_JOIN_PARTITION_BY)
    .keyword("partition by")
origin: com.ning.billing/killbill-osgi-bundles-analytics

  .declareTables(false)
  .end(MERGE_MERGE_INTO)
  .formatSeparator()
  .start(MERGE_USING)
  .declareTables(true)
  .formatSeparator()
  .start(MERGE_ON)
context.formatSeparator()
    .keyword("when matched then update set").sql(" ")
    .visit(matchedUpdate);
context.formatSeparator()
    .keyword("where").sql(" ")
    .visit(matchedWhere);
context.formatSeparator()
    .keyword("delete where").sql(" ")
    .visit(matchedDeleteWhere);
context.formatSeparator()
    .keyword("when not matched then insert").sql(" ");
notMatchedInsert.toSQLReferenceKeys(context);
context.formatSeparator()
    .start(MERGE_VALUES)
    .keyword("values").sql(" ")
context.formatSeparator()
origin: com.ning.billing/killbill-osgi-bundles-analytics

  boolean first = true;
  for (Field<?> field : using) {
    context.formatSeparator();
  context.formatSeparator()
      .start(TABLE_JOIN_USING)
      .keyword("using")
    context.formatSeparator();
context.formatSeparator()
    .start(TABLE_JOIN_ON)
    .keyword("on")
origin: com.ning.billing/killbill-osgi-bundles-analytics

context.formatSeparator()
    .keyword("for update");
    context.formatSeparator()
        .keyword("lock in share mode");
    break;
    context.formatSeparator()
        .keyword("for share");
    break;
context.formatSeparator()
    .sql(option);
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  boolean declare = context.declareTables();
  context.start(DELETE_DELETE)
      .keyword("delete").sql(" ");
  // [#2464] MySQL supports a peculiar multi-table DELETE syntax for aliased tables:
  // DELETE t1 FROM my_table AS t1
  if (asList(MARIADB, MYSQL).contains(context.configuration().dialect())) {
    // [#2579] TODO: Improve Table API to discover aliased tables more
    // reliably instead of resorting to instanceof:
    if (getFrom() instanceof TableAlias ||
      (getFrom() instanceof TableImpl && ((TableImpl<R>)getFrom()).getAliasedTable() != null)) {
      context.visit(getFrom())
          .sql(" ");
    }
  }
  context.keyword("from").sql(" ")
      .declareTables(true)
      .visit(getFrom())
      .declareTables(declare)
      .end(DELETE_DELETE)
      .start(DELETE_WHERE);
  if (!(getWhere() instanceof TrueCondition)) {
    context.formatSeparator()
        .keyword("where").sql(" ")
        .visit(getWhere());
  }
  context.end(DELETE_WHERE);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

    .sql(",")
    .formatIndentStart()
    .formatSeparator()
    .visit(limitOffsetRownumber)
    .formatIndentEnd()
context.formatSeparator()
    .keyword("from")
    .sql(" ")
context.formatSeparator()
    .keyword("where")
    .sql(" ")
context.formatSeparator()
    .keyword("start with")
    .sql(" ")
context.formatSeparator()
    .keyword("connect by");
context.formatSeparator()
    .keyword("group by")
    .sql(" ");
context.formatSeparator()
    .keyword("having")
    .sql(" ")
origin: com.ning.billing/killbill-osgi-bundles-analytics

case SQLITE: {
  context.castMode(NEVER)
      .formatSeparator()
      .keyword("limit")
      .sql(" ").visit(numberOfRows)
      .formatSeparator()
      .keyword("limit")
      .sql(" ").visit(offsetOrZero)
      .formatSeparator()
      .keyword("rows")
      .sql(" ").visit(getLowerRownum().add(inline(1)))
      .formatSeparator()
      .keyword("offset")
      .sql(" ").visit(offsetOrZero)
      .formatSeparator()
      .keyword("limit")
      .sql(" ").visit(numberOfRows)
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final void toSQL(RenderContext context) {
  context.start(INSERT_INSERT_INTO)
      .keyword("insert into")
      .sql(" ")
      .visit(into)
      .sql(" (");
  // [#989] Avoid qualifying fields in INSERT field declaration
  boolean qualify = context.qualify();
  context.qualify(false);
  String separator = "";
  for (Field<?> field : fields) {
    context.sql(separator)
        .visit(field);
    separator = ", ";
  }
  context.qualify(qualify);
  context.sql(")")
      .end(INSERT_INSERT_INTO)
      .formatSeparator()
      .start(INSERT_SELECT)
      .visit(select)
      .end(INSERT_SELECT)
      .start(INSERT_ON_DUPLICATE_KEY_UPDATE)
      .end(INSERT_ON_DUPLICATE_KEY_UPDATE)
      .start(INSERT_RETURNING)
      .end(INSERT_RETURNING);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

context.formatSeparator()
    .start(UPDATE_SET)
    .keyword("set")
      context.formatSeparator()
          .keyword("from").sql(" ")
          .visit(from);
  context.formatSeparator()
      .keyword("where").sql(" ")
      .visit(getWhere());
origin: com.ning.billing/killbill-osgi-bundles-analytics

private final void toSQLH2(RenderContext context) {
  context.keyword("merge into")
      .sql(" ")
      .declareTables(true)
      .visit(table)
      .formatSeparator();
  context.sql("(");
  Utils.fieldNames(context, getH2Fields());
  context.sql(")");
  if (!getH2Keys().isEmpty()) {
    context.sql(" ").keyword("key").sql(" (");
    Utils.fieldNames(context, getH2Keys());
    context.sql(")");
  }
  if (h2Select != null) {
    context.sql(" ")
        .visit(h2Select);
  }
  else {
    context.sql(" ").keyword("values").sql(" (")
        .visit(getH2Values())
        .sql(")");
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

for (Row row : rows) {
  if (!firstRow) {
    context.sql(",").formatSeparator();
origin: com.ning.billing/killbill-osgi-bundles-analytics

case MYSQL: {
  toSQLInsert(context);
  context.formatSeparator()
      .start(INSERT_ON_DUPLICATE_KEY_UPDATE)
      .keyword("on duplicate key update")
  context.formatSeparator()
      .start(INSERT_ON_DUPLICATE_KEY_UPDATE)
      .keyword("on duplicate key update")
org.jooqRenderContextformatSeparator

Javadoc

Render a new line character (only if Settings#isRenderFormatted()is set to true), or a whitespace separator character otherwise.

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,
  • keyword,
  • literal,
  • nextAlias

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • Menu (java.awt)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • 21 Best IntelliJ Plugins
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