From 92b7d42ffd5e962d75b1b1a0420b70523ba5315c Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 11 Feb 2013 15:39:24 +0100 Subject: [PATCH] [#1663] Document RenderContext and make it part of the public API --- .../src/main/resources/manual-3.0.xml | 3 ++ jOOQ/src/main/java/org/jooq/Context.java | 4 +-- .../src/main/java/org/jooq/RenderContext.java | 7 ++--- .../src/main/java/org/jooq/impl/Executor.java | 30 +++++++++++-------- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/jOOQ-website/src/main/resources/manual-3.0.xml b/jOOQ-website/src/main/resources/manual-3.0.xml index ff2697da0d..62f4b7ca65 100644 --- a/jOOQ-website/src/main/resources/manual-3.0.xml +++ b/jOOQ-website/src/main/resources/manual-3.0.xml @@ -5247,6 +5247,9 @@ final Field IDx2 = new CustomField(BOOK.ID.getName(), BOOK.ID. create.select(IDx2).from(BOOK);]]> + +
+
Plain SQL QueryParts diff --git a/jOOQ/src/main/java/org/jooq/Context.java b/jOOQ/src/main/java/org/jooq/Context.java index 8ebb144d53..6e47cb3297 100644 --- a/jOOQ/src/main/java/org/jooq/Context.java +++ b/jOOQ/src/main/java/org/jooq/Context.java @@ -38,9 +38,7 @@ package org.jooq; import java.sql.PreparedStatement; /** - * A context type that is used for rendering SQL or for binding - *

- * This interface is for JOOQ INTERNAL USE only. Do not reference directly + * A context type that is used for rendering SQL or for binding. * * @author Lukas Eder * @see BindContext diff --git a/jOOQ/src/main/java/org/jooq/RenderContext.java b/jOOQ/src/main/java/org/jooq/RenderContext.java index 9598cc6371..cecd18f61b 100644 --- a/jOOQ/src/main/java/org/jooq/RenderContext.java +++ b/jOOQ/src/main/java/org/jooq/RenderContext.java @@ -39,11 +39,10 @@ import org.jooq.conf.RenderKeywordStyle; import org.jooq.conf.Settings; /** - * The render context is used for rendering {@link QueryPart}'s to SQL. A new - * render context is instanciated every time a {@link Query} is rendered. - * QueryPart's will then pass the same context to their components + * The render context is used for rendering {@link QueryPart}'s to SQL. *

- * This interface is for JOOQ INTERNAL USE only. Do not reference directly + * A new render context is instanciated every time a {@link Query} is rendered. + * QueryPart's will then pass the same context to their components * * @author Lukas Eder * @see BindContext diff --git a/jOOQ/src/main/java/org/jooq/impl/Executor.java b/jOOQ/src/main/java/org/jooq/impl/Executor.java index 08b8c20254..dddcc3d02d 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Executor.java +++ b/jOOQ/src/main/java/org/jooq/impl/Executor.java @@ -451,24 +451,28 @@ public class Executor implements Configuration { // ------------------------------------------------------------------------- /** - * Get a new {@link RenderContext} for the context of this executor + * Get a new {@link RenderContext} for the context of this executor. *

* This will return an initialised render context as such: *

    + *
  • + * {@link RenderContext#castMode()} == {@link org.jooq.RenderContext.CastMode#DEFAULT DEFAULT} + *
  • *
  • {@link RenderContext#declareFields()} == false
  • *
  • {@link RenderContext#declareTables()} == false
  • + *
  • {@link RenderContext#format()} == false
  • *
  • {@link RenderContext#inline()} == false
  • *
  • {@link RenderContext#namedParams()} == false
  • + *
  • {@link RenderContext#qualify()} == true
  • + *
  • {@link RenderContext#subquery()} == false
  • *
- *

- * RenderContext for JOOQ INTERNAL USE only. Avoid referencing it directly */ public final RenderContext renderContext() { return new DefaultRenderContext(this); } /** - * Render a QueryPart in the context of this executor + * Render a QueryPart in the context of this executor. *

* This is the same as calling renderContext().render(part) * @@ -509,7 +513,7 @@ public class Executor implements Configuration { /** * Retrieve the bind values that will be bound by a given - * QueryPart + * QueryPart. *

* The returned List is immutable. To modify bind values, use * {@link #extractParams(QueryPart)} instead. @@ -525,7 +529,7 @@ public class Executor implements Configuration { } /** - * Get a Map of named parameters + * Get a Map of named parameters. *

* The Map itself is immutable, but the {@link Param} elements * allow for modifying bind values on an existing {@link Query} (or any @@ -557,7 +561,7 @@ public class Executor implements Configuration { } /** - * Get a new {@link BindContext} for the context of this executor + * Get a new {@link BindContext} for the context of this executor. *

* This will return an initialised bind context as such: *

    @@ -572,7 +576,7 @@ public class Executor implements Configuration { } /** - * Get a new {@link BindContext} for the context of this executor + * Get a new {@link BindContext} for the context of this executor. *

    * This will return an initialised bind context as such: *

      @@ -591,14 +595,14 @@ public class Executor implements Configuration { // ------------------------------------------------------------------------- /** - * Attach this Executor to some attachables + * Attach this Executor to some attachables. */ public final void attach(Attachable... attachables) { attach(Arrays.asList(attachables)); } /** - * Attach this Executor to some attachables + * Attach this Executor to some attachables. */ public final void attach(Collection attachables) { for (Attachable attachable : attachables) { @@ -612,7 +616,7 @@ public class Executor implements Configuration { /** * Create a new Loader object to load data from a CSV or XML - * source + * source. */ @Support public final > LoaderOptionsStep loadInto(Table table) { @@ -621,7 +625,7 @@ public class Executor implements Configuration { /** * Create a new query holding plain SQL. There must not be any binding - * variables contained in the SQL + * variables contained in the SQL. *

      * Example: *

      @@ -643,7 +647,7 @@ public class Executor implements Configuration { /** * Create a new query holding plain SQL. There must be as many bind - * variables contained in the SQL, as passed in the bindings parameter + * variables contained in the SQL, as passed in the bindings parameter. *

      * Example: *