From 1b04fb27d7b2ebf84568c43d4f5e979afa46a309 Mon Sep 17 00:00:00 2001
From: lukaseder
- If you don't need the integration of rather complex QueryParts into jOOQ, then you might be safer using simple
- The above distinction is best explained using an example:
-
+ If you don't need the integration of rather complex QueryParts into jOOQ, then you might be safer using simple
+ The above distinction is best explained using an example:
+
- The above technique allows for creating rather complex SQL clauses that are currently not supported by jOOQ, without extending any of the
+ Note that for historic reasons the two API usages can also be mixed, although this is not recommended and the exact behaviour is unspecified.
+
+ Templating with QueryPart placeholders (or bind value placeholders) requires a simple parsing logic to be applied to SQL strings. The jOOQ template parser behaves according to the following rules:
+
+ A variety of API is provided to create template elements that are intended for use with the above templating mechanism. These tools can be found in
- If you don't need the integration of rather complex QueryParts into jOOQ, then you might be safer using simple
- The above distinction is best explained using an example:
-
+ If you don't need the integration of rather complex QueryParts into jOOQ, then you might be safer using simple
+ The above distinction is best explained using an example:
+
- The above technique allows for creating rather complex SQL clauses that are currently not supported by jOOQ, without extending any of the
+ Note that for historic reasons the two API usages can also be mixed, although this is not recommended and the exact behaviour is unspecified.
+
+ Templating with QueryPart placeholders (or bind value placeholders) requires a simple parsing logic to be applied to SQL strings. The jOOQ template parser behaves according to the following rules:
+
+ A variety of API is provided to create template elements that are intended for use with the above templating mechanism. These tools can be found in
- If you don't need the integration of rather complex QueryParts into jOOQ, then you might be safer using simple
- The above distinction is best explained using an example:
-
+ If you don't need the integration of rather complex QueryParts into jOOQ, then you might be safer using simple
+ The above distinction is best explained using an example:
+
- The above technique allows for creating rather complex SQL clauses that are currently not supported by jOOQ, without extending any of the
+ Note that for historic reasons the two API usages can also be mixed, although this is not recommended and the exact behaviour is unspecified.
+
+ Templating with QueryPart placeholders (or bind value placeholders) requires a simple parsing logic to be applied to SQL strings. The jOOQ template parser behaves according to the following rules:
+
+ A variety of API is provided to create template elements that are intended for use with the above templating mechanism. These tools can be found in
-
-
+
+ Plain SQL templating specification
+
+
+
+
+ -- in all databases (or #) in MySQL) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored./* and ending with */ in all databases) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.' in all databases, where all databases support escaping of the quote character by duplication as such: '', or in MySQL by escaping as such: \' (if " in most databases, with ` in MySQL, or with [ and ] in T-SQL databases) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.{fn ...}, {d ...}, {t ...}, {ts ...}) is rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.? or :name for named bind variables) are replaced by the matching bind value in case inlining is activated, e.g. through {number}) are replaced by the matching QueryPart.{identifier}) are treated like keywords and rendered in the correct case according to Tools for templating
+
+
-
-
+
+ Plain SQL templating specification
+
+
+
+
+ -- in all databases (or #) in MySQL) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored./* and ending with */ in all databases) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.' in all databases, where all databases support escaping of the quote character by duplication as such: '', or in MySQL by escaping as such: \' (if " in most databases, with ` in MySQL, or with [ and ] in T-SQL databases) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.{fn ...}, {d ...}, {t ...}, {ts ...}) is rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.? or :name for named bind variables) are replaced by the matching bind value in case inlining is activated, e.g. through {number}) are replaced by the matching QueryPart.{identifier}) are treated like keywords and rendered in the correct case according to Tools for templating
+
+
-
-
+
+ Plain SQL templating specification
+
+
+
+
+ -- in all databases (or #) in MySQL) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored./* and ending with */ in all databases) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.' in all databases, where all databases support escaping of the quote character by duplication as such: '', or in MySQL by escaping as such: \' (if " in most databases, with ` in MySQL, or with [ and ] in T-SQL databases) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.{fn ...}, {d ...}, {t ...}, {ts ...}) is rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.? or :name for named bind variables) are replaced by the matching bind value in case inlining is activated, e.g. through {number}) are replaced by the matching QueryPart.{identifier}) are treated like keywords and rendered in the correct case according to Tools for templating
+
+
- The above technique allows for creating rather complex SQL clauses that are currently not supported by jOOQ, without extending any of the
+ Templating with QueryPart placeholders (or bind value placeholders) requires a simple parsing logic to be applied to SQL strings. The jOOQ template parser behaves according to the following rules: +
+ +-- in all databases (or #) in MySQL) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored./* and ending with */ in all databases) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.' in all databases, where all databases support escaping of the quote character by duplication as such: '', or in MySQL by escaping as such: \' (if " in most databases, with ` in MySQL, or with [ and ] in T-SQL databases) are rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.{fn ...}, {d ...}, {t ...}, {ts ...}) is rendered without modification. Any bind variable or QueryPart placeholders in such comments are ignored.? or :name for named bind variables) are replaced by the matching bind value in case inlining is activated, e.g. through {number}) are replaced by the matching QueryPart.{identifier}) are treated like keywords and rendered in the correct case according to
+ A variety of API is provided to create template elements that are intended for use with the above templating mechanism. These tools can be found in
+ * Use this method to construct syntax-safe, SQL-injection-safe SQL + * identifiers for use in plain SQL where {@link QueryPart} objects are + * accepted. For instance, this can be used with any of these methods: + *
+ * An example:
- * Use this method to construct syntax-safe, SQL-injection-safe SQL
- * identifiers for use in plain SQL where {@link QueryPart} objects are
- * accepted. For instance, this can be used with any of these methods:
- *
- * An example:
+ *
+ * @param qualifiedName The SQL identifier's qualified name parts
+ * @return A {@link QueryPart} that will render the SQL identifier
+ */
+ public static Name name(String... qualifiedName) {
+ return new NameImpl(qualifiedName);
+ }
+
// -------------------------------------------------------------------------
// XXX QueryPart composition
// -------------------------------------------------------------------------
@@ -7033,33 +7064,6 @@ public class DSL {
return new SQLField
+ * // This qualified name here
+ * name("book", "title");
+ *
+ * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
+ * [book].[title]
+ *
- *
- *
- *
- * @param qualifiedName The SQL identifier's qualified name parts
- * @return A {@link QueryPart} that will render the SQL identifier
- */
- public static Name name(String... qualifiedName) {
- return new NameImpl(qualifiedName);
- }
-
/**
* Create a qualified schema, given its schema name.
*
- * // This qualified name here
- * name("book", "title");
- *
- * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
- * [book].[title]
- *