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

How to use
end
method
in
org.jooq.RenderContext

Best Java code snippets using org.jooq.RenderContext.end (Showing top 14 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) {
  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

@Override
public final void toSQL(RenderContext context) {
  if (size() > 0) {
    String separator = "";
    // [#989] Some dialects do not support qualified column references
    // in the UPDATE statement's SET clause
    // [#2055] Other dialects require qualified column references to
    // disambiguated columns in queries like
    // UPDATE t1 JOIN t2 .. SET t1.val = ..., t2.val = ...
    boolean restoreQualify = context.qualify();
    boolean supportsQualify = asList(POSTGRES, SQLITE).contains(context.configuration().dialect()) ? false : restoreQualify;
    for (Entry<Field<?>, Field<?>> entry : entrySet()) {
      context.sql(separator);
      if (!"".equals(separator)) {
        context.formatNewLine();
      }
      context.start(assignmentClause)
          .qualify(supportsQualify)
          .visit(entry.getKey())
          .qualify(restoreQualify)
          .sql(" = ")
          .visit(entry.getValue())
          .end(assignmentClause);
      separator = ", ";
    }
  }
  else {
    context.sql("[ no fields are updated ]");
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

.sql(" ")
.visit(insertMaps.get(0))
.end(INSERT_VALUES);
    .start(INSERT_SELECT);
context.visit(insertSelect(context));
context.end(INSERT_SELECT);
    .sql(" ");
toSQL92Values(context);
context.end(INSERT_VALUES);
origin: com.ning.billing/killbill-osgi-bundles-analytics

      .visit(rhsPartitionBy)
      .sql(")")
      .end(TABLE_JOIN_PARTITION_BY);
context.end(translatedClause)
    .formatIndentEnd();
origin: com.ning.billing/killbill-osgi-bundles-analytics

    .visit(table)
    .declareTables(false)
    .end(MERGE_MERGE_INTO)
    .formatSeparator()
    .start(MERGE_USING)
context.end(MERGE_USING)
    .formatSeparator()
    .start(MERGE_ON)
    .visit(on)
    .sql(onParentheses ? ")" : "")
    .end(MERGE_ON)
    .start(MERGE_WHEN_MATCHED_THEN_UPDATE)
    .start(MERGE_SET);
context.end(MERGE_SET)
    .start(MERGE_WHERE);
context.end(MERGE_WHERE)
    .start(MERGE_DELETE_WHERE);
context.end(MERGE_DELETE_WHERE)
    .end(MERGE_WHEN_MATCHED_THEN_UPDATE)
    .start(MERGE_WHEN_NOT_MATCHED_THEN_INSERT);
      .keyword("values").sql(" ")
      .visit(notMatchedInsert)
      .end(MERGE_VALUES);
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

  context.end(TABLE_JOIN_ON);
  Utils.fieldNames(context, using);
  context.sql(")")
      .end(TABLE_JOIN_USING);
context.end(TABLE_JOIN_ON);
    .sql(" ")
    .visit(condition)
    .end(TABLE_JOIN_ON);
origin: com.ning.billing/killbill-osgi-bundles-analytics

    .visit(getInto())
    .declareTables(false)
    .end(UPDATE_UPDATE);
  context.end(UPDATE_SET_ASSIGNMENT);
context.end(UPDATE_SET);
    context.end(UPDATE_FROM);
    break;
context.end(UPDATE_WHERE)
    .start(UPDATE_RETURNING);
context.end(UPDATE_RETURNING);
origin: com.ning.billing/killbill-osgi-bundles-analytics

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

          .sql(" ")
          .visit(updateMap)
          .end(INSERT_ON_DUPLICATE_KEY_UPDATE);
      toSQLInsert(context);
      context.start(INSERT_ON_DUPLICATE_KEY_UPDATE)
          .end(INSERT_ON_DUPLICATE_KEY_UPDATE);
      break;
          .sql(" ")
          .visit(update)
          .end(INSERT_ON_DUPLICATE_KEY_UPDATE);
  toSQLInsert(context);
  context.start(INSERT_ON_DUPLICATE_KEY_UPDATE)
      .end(INSERT_ON_DUPLICATE_KEY_UPDATE);
context.end(INSERT_RETURNING);
origin: com.ning.billing/killbill-osgi-bundles-analytics

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

    .end(SELECT_SELECT);
    .end(SELECT_FROM);
context.end(SELECT_WHERE);
context.end(SELECT_START_WITH);
context.start(SELECT_CONNECT_BY);
context.end(SELECT_CONNECT_BY);
context.end(SELECT_GROUP_BY);
context.end(SELECT_HAVING);
context.end(SELECT_WINDOW);
context.end(SELECT_ORDER_BY);
origin: com.ning.billing/killbill-osgi-bundles-analytics

    .end(TABLE_VALUES);
break;
org.jooqRenderContextend

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
  • formatIndentEnd
    Stop indenting subsequent SQL by a number of characters, if Settings#isRenderFormatted() is set to t
  • formatIndentLockEnd
    Stop indenting subsequent SQL at the same level as the current line, if Settings#isRenderFormatted()
  • formatIndentEnd,
  • formatIndentLockEnd,
  • formatIndentLockStart,
  • formatIndentStart,
  • formatNewLine,
  • formatSeparator,
  • keyword,
  • literal,
  • nextAlias

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • getContentResolver (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook Extensions
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