private final void toSQLInParam(RenderContext context, Parameter<?> parameter, Field<?> value) { /* [pro] xx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x xxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx xx xxx xxxxxx x xx [/pro] */ context.visit(value); }
/** * The default LIMIT / OFFSET clause in most dialects */ private void toSQLReferenceLimitDefault(RenderContext context) { toSQLReference0(context); context.visit(getLimit()); }
private void toSQLWrapped(RenderContext context) { context.sql(wrapInParentheses ? "(" : "") .visit(wrapped) .sql(wrapInParentheses ? ")" : ""); }
@Override public final void toSQL(RenderContext context) { context.visit(row) .sql(" ") .keyword(isNull ? "is null" : "is not null"); }
static final void pgRenderRecordCast(RenderContext render, Record value) { if (value instanceof UDTRecord) render.sql("::").visit(((UDTRecord<?>) value).getUDT().getQualifiedName()); else if (value instanceof TableRecord) render.sql("::").visit(((TableRecord<?>) value).getTable().getQualifiedName()); }
@Override final void sqlInline0(BindingSQLContext<U> ctx, Boolean value) { // [#1153] Some dialects don't support boolean literals TRUE and FALSE if (BIND_AS_1_0.contains(ctx.family())) ctx.render().sql(value ? "1" : "0"); else ctx.render().visit(value ? K_TRUE : K_FALSE); }
@Override public final void toSQL(RenderContext context) { context.sql("("); String separator = ""; for (Field<?> field : fields.fields) { context.sql(separator); context.visit(field); separator = ", "; } context.sql(")"); }
private final void sql(BindingSQLContext<U> ctx, T value) throws SQLException { if (ctx.render().paramType() == INLINED) if (value == null) ctx.render().visit(K_NULL); else sqlInline0(ctx, value); else sqlBind0(ctx, value); }
private final void toSQLQualifiedName(RenderContext ctx) { if (ctx.qualify()) { Schema mapped = Tools.getMappedSchema(ctx.configuration(), getSchema()); if (mapped != null && !"".equals(mapped.getName())) ctx.visit(mapped) .sql('.'); } ctx.literal(getName()); }
@Override public final void toSQL(RenderContext context) { context.data(DATA_OMIT_CLAUSE_EVENT_EMISSION, true); if (context.qualify()) { context.visit(table); context.sql("."); } context.literal(getName()); context.data(DATA_OMIT_CLAUSE_EVENT_EMISSION, null); }
private final void toSQLFunctionName(RenderContext ctx) { if (name != null) { ctx.visit(name); } else if (term != null) { ctx.sql(term.translate(ctx.configuration().dialect())); } else { ctx.sql(getName()); } }
@Override public void sql(BindingSQLContext<JsonObject> ctx) throws SQLException { // Depending on how you generate your SQL, you may need to explicitly distinguish // between jOOQ generating bind variables or inlined literals. If so, use this check: // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); }
@Override public void sql(BindingSQLContext<JsonArray> ctx) throws SQLException { // Depending on how you generate your SQL, you may need to explicitly distinguish // between jOOQ generating bind variables or inlined literals. If so, use this check: // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); }
@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()); } }
/** * 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(")"); } }
@Override final void sqlInline0(BindingSQLContext<U> ctx, Record value) throws SQLException { if ( ctx.family() == POSTGRES) { ctx.render().visit(inline(PostgresUtils.toPGString(value))); pgRenderRecordCast(ctx.render(), value); } else ctx.render().sql("[UDT]"); }
private void toSQLInline(RenderContext context) { context.sql(getInlineConstructor(context)); context.sql("("); String separator = ""; for (Field<?> field : value.fields()) { context.sql(separator); context.visit(val(value.getValue(field), field)); separator = ", "; } context.sql(")"); }