@Override public String renderInlined(QueryPart part) { return delegate.renderInlined(part); }
@Override public int hashCode() { // This is a working default implementation. It should be overridden by // concrete subclasses, to improve performance return create().renderInlined(this).hashCode(); }
@Override public int hashCode() { // This is a working default implementation. It should be overridden by // concrete subclasses, to improve performance return create().renderInlined(this).hashCode(); }
@Override public boolean equals(Object that) { if (this == that) { return true; } // This is a working default implementation. It should be overridden by // concrete subclasses, to improve performance if (that instanceof QueryPart) { DSLContext dsl = configuration().dsl(); String sql1 = dsl.renderInlined(this); String sql2 = dsl.renderInlined((QueryPart) that); return sql1.equals(sql2); } return false; }
@Override public boolean equals(Object that) { if (this == that) { return true; } // This is a working default implementation. It should be overridden by // concrete subclasses, to improve performance if (that instanceof QueryPart) { String sql1 = create().renderInlined(this); String sql2 = create().renderInlined((QueryPart) that); return sql1.equals(sql2); } return false; }
@Override public String toString() { try { return create().renderInlined(this); } catch (SQLDialectNotSupportedException e) { return "[ ... " + e.getMessage() + " ... ]"; } }
private String formatted(Query query) { return DSL.using(configuration.derive(newSettings)).renderInlined(query); } });
@Override public String toString() { return DSL.using(configuration()).renderInlined(DSL.inline(this)); } }
protected int customizedCount(SelectJoinStep<Record1<Integer>> input, Condition condition) { Select<Record1<Integer>> select = input; if (condition != null) { select = input.where(condition); } String sql = select.getSQL(); List<Object> arguments = select.getBindValues(); Object[] argumentsArray = arguments.toArray(new Object[arguments.size()]); LogStopWatch stopWatch = null; if (useMetrics) { stopWatch = new LogStopWatch(); } int count = this.ejt.queryForInt(sql, argumentsArray, 0); if (stopWatch != null) { stopWatch.stop("customizedCount(): " + this.create.renderInlined(select), metricsThreshold); } return count; }
/** * {@inheritDoc} */ @Override public final String getSQL(ParamType paramType) { switch (paramType) { case INDEXED: return create().render(this); case INLINED: return create().renderInlined(this); case NAMED: return create().renderNamedParams(this); } throw new IllegalArgumentException("ParamType not supported: " + paramType); }
@Override public final void formatInsert(Writer writer, Table<?> table, Field<?>... f) { DSLContext ctx = configuration.dsl(); try { for (R record : this) { if (table == null) if (record instanceof TableRecord) table = ((TableRecord<?>) record).getTable(); else table = table(name("UNKNOWN_TABLE")); writer.append(ctx.renderInlined(insertInto(table, f).values(record.intoArray()))) .append(";\n"); } writer.flush(); } catch (java.io.IOException e) { throw new IOException("Exception while writing INSERTs", e); } }
/** * {@inheritDoc} */ @Override public final String getSQL(ParamType paramType) { switch (paramType) { case INDEXED: return create().render(this); case INLINED: return create().renderInlined(this); case NAMED: return create().renderNamedParams(this); case NAMED_OR_INLINED: return create().renderNamedOrInlinedParams(this); } throw new IllegalArgumentException("ParamType not supported: " + paramType); }
@Override public String toString() { try { return create(configuration().derive(SettingsTools.clone(configuration().settings()).withRenderFormatted(true))).renderInlined(this); } catch (SQLDialectNotSupportedException e) { return "[ ... " + e.getMessage() + " ... ]"; } }
stopWatch.stop("customizedQuery(): " + this.create.renderInlined(offsetStep), metricsThreshold);
String inlined = DSL.using(configuration).renderInlined(ctx.query()); if (!ctx.sql().equals(inlined)) log.debug("-> with bind values", newline + inlined); .renderInlined(ctx.routine());
String inlined = DSL.using(configuration).renderInlined(ctx.query()); if (!ctx.sql().equals(inlined)) { log.debug("-> with bind values", inlined); .renderInlined(ctx.routine());
field.getDataType().scale(), field.getDataType().nullable(), create().renderInlined(field.getDataType().defaultValue()), (Name) null );
for (int i = 0; i < queries.length; i++) { listener.renderStart(ctx); batchSQL[i] = DSL.using(configuration).renderInlined(queries[i]); listener.renderEnd(ctx);
ctx.sql(null); listener.renderStart(ctx); batchSQL[i] = DSL.using(configuration).renderInlined(queries[i]); ctx.sql(batchSQL[i]); listener.renderEnd(ctx);