/** * Internal convenience method */ protected final DSLContext create(RenderContext ctx) { return DSL.using(ctx.configuration()); }
@Deprecated private final String getInlineConstructor(RenderContext ctx) { switch (ctx.family()) { case POSTGRES: return "ROW"; // Assume default behaviour if dialect is not available default: return Tools.getMappedUDTName(ctx.configuration(), value); } }
@Override public final void toSQL(RenderContext ctx) { delegate(ctx.configuration()).toSQL(ctx); }
static void toSQLAs(RenderContext context) { if (asList(DERBY, HSQLDB, MARIADB, MYSQL, POSTGRES).contains(context.configuration().dialect())) { context.sql(" ").keyword("as"); } }
@Override public final void toSQL(RenderContext ctx) { ctx.visit(table(ctx.configuration())); }
@Override public final void toSQL(RenderContext context) { context.visit(condition(context.configuration())); }
@Override public final void toSQL(RenderContext context) { context.visit(pivot(context.configuration())); }
@Override public final void toSQL(RenderContext ctx) { ctx.visit(delegate(ctx.configuration())); }
@Override public final void toSQL(RenderContext ctx) { delegate(ctx.configuration()).toSQL(ctx); }
@Override public final void toSQL(RenderContext ctx) { ctx.visit(table(ctx.configuration())); }
@Override public final void toSQL(RenderContext ctx) { delegate(ctx.configuration(), ctx).toSQL(ctx); }
private final void toSQLAssign(RenderContext context) { switch (context.configuration().dialect().family()) { /* [pro] xx xxxx xxxxxxx xxxxxxxxxxxxxx xx xxx xxxxxx xx [/pro] */ default: context.sql("? = "); break; } }
@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()); } }
private final void toSQLCall(RenderContext context) { switch (context.configuration().dialect().family()) { /* [pro] xx xxxx xxxxxxx xxxxxx xx [/pro] */ default: context.sql("call "); break; } toSQLQualifiedName(context); }
private final Select<Record> insertSelect(RenderContext context) { Select<Record> select = null; for (FieldMapForInsert map : insertMaps) { if (map != null) { Select<Record> iteration = DSL.using(context.configuration()).select(map.values()); if (select == null) { select = iteration; } else { select = select.unionAll(iteration); } } } return select; }
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()); }
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()); } }
DefaultRenderContext(RenderContext context) { this(context.configuration()); paramType(context.paramType()); qualify(context.qualify()); castMode(context.castMode()); declareFields(context.declareFields()); declareTables(context.declareTables()); data().putAll(context.data()); }
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(")"); }
DefaultRenderContext(RenderContext context) { this(context.configuration()); paramType(context.paramType()); qualifyCatalog(context.qualifyCatalog()); qualifySchema(context.qualifySchema()); quote(context.quote()); castMode(context.castMode()); data().putAll(context.data()); declareCTE = context.declareCTE(); declareWindows = context.declareWindows(); declareFields = context.declareFields(); declareTables = context.declareTables(); declareAliases = context.declareAliases(); }