From 163f398b7742714d2979621849ef3ec0c96bbeb3 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Thu, 14 Jul 2016 18:04:34 +0200 Subject: [PATCH] [#5415] Recommend using third party Gradle plugin for jOOQ instead of hand-written Groovy code --- .../resources/org/jooq/web/manual-2.5.xml | 4 +- .../resources/org/jooq/web/manual-2.6.xml | 4 +- .../resources/org/jooq/web/manual-3.0.xml | 4 +- .../resources/org/jooq/web/manual-3.1.xml | 4 +- .../resources/org/jooq/web/manual-3.2.xml | 4 +- .../resources/org/jooq/web/manual-3.3.xml | 4 +- .../resources/org/jooq/web/manual-3.4.xml | 75 +-------------- .../resources/org/jooq/web/manual-3.5.xml | 75 +-------------- .../resources/org/jooq/web/manual-3.6.xml | 75 +-------------- .../resources/org/jooq/web/manual-3.7.xml | 89 +++--------------- .../resources/org/jooq/web/manual-3.8.xml | 91 +++---------------- 11 files changed, 44 insertions(+), 385 deletions(-) diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-2.5.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-2.5.xml index ca7a38ed5a..a2fa747a5e 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-2.5.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-2.5.xml @@ -555,8 +555,8 @@ CREATE TABLE `posts` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-2.6.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-2.6.xml index f942df6661..5557e5a6f3 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-2.6.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-2.6.xml @@ -693,8 +693,8 @@ CREATE TABLE `posts` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.0.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.0.xml index 07dc6b49ab..77735f441c 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.0.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.0.xml @@ -840,8 +840,8 @@ CREATE TABLE `posts` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.1.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.1.xml index b08b94636c..08f50e7110 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.1.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.1.xml @@ -840,8 +840,8 @@ CREATE TABLE `posts` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.2.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.2.xml index 9da1fdf70d..9a8216afeb 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.2.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.2.xml @@ -865,8 +865,8 @@ CREATE TABLE `author` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.3.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.3.xml index 23770a5043..1f54b00df3 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.3.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.3.xml @@ -871,8 +871,8 @@ CREATE TABLE `author` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.4.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.4.xml index 5384cc83de..3c49f33cf2 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.4.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.4.xml @@ -872,8 +872,8 @@ CREATE TABLE `author` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> @@ -11835,76 +11835,7 @@ Finishing : Total: 4.814ms, +3.375ms

Run generation with Gradle

- While some third-party Gradle plugins exist (e.g. the one by Etienne Studer from Gradleware), we generally recommend new users to use jOOQ's standalone code generator for simplicity. The following working example build.gradle script should work out of the box: -

- - -

- This example is frequently updated on GitHub: https://github.com/jOOQ/jOOQ/tree/master/jOOQ-examples/jOOQ-codegen-gradle + We recommend using the Gradle plugin by Etienne Studer from Gradle Inc.). It provides a concise DSL that allows you to tune all configuration properties supported by each jOOQ version.

diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml index 94450b3eff..346a52133a 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml @@ -872,8 +872,8 @@ CREATE TABLE `author` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> @@ -12281,76 +12281,7 @@ Finishing : Total: 4.814ms, +3.375ms

Run generation with Gradle

- While some third-party Gradle plugins exist (e.g. the one by Etienne Studer from Gradleware), we generally recommend new users to use jOOQ's standalone code generator for simplicity. The following working example build.gradle script should work out of the box: -

- - -

- This example is frequently updated on GitHub: https://github.com/jOOQ/jOOQ/tree/master/jOOQ-examples/jOOQ-codegen-gradle + We recommend using the Gradle plugin by Etienne Studer from Gradle Inc.). It provides a concise DSL that allows you to tune all configuration properties supported by each jOOQ version.

diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml index ab2e2a4674..8a533ec7df 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml @@ -876,8 +876,8 @@ CREATE TABLE `author` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> @@ -14748,76 +14748,7 @@ public class Book {

Run generation with Gradle

- While some third-party Gradle plugins exist (e.g. the one by Etienne Studer from Gradleware), we generally recommend new users to use jOOQ's standalone code generator for simplicity. The following working example build.gradle script should work out of the box: -

- - -

- This example is frequently updated on GitHub: https://github.com/jOOQ/jOOQ/tree/master/jOOQ-examples/jOOQ-codegen-gradle + We recommend using the Gradle plugin by Etienne Studer from Gradle Inc.). It provides a concise DSL that allows you to tune all configuration properties supported by each jOOQ version.

diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml index a836f599fc..58416c9079 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml @@ -934,8 +934,8 @@ CREATE TABLE `author` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> @@ -2748,10 +2748,10 @@ DSL.using(sql.connection) jOOQ and Kotlin

- As any other library, jOOQ can be easily used in Groovy, taking advantage of the many Groovy language features such as for example: + As any other library, jOOQ can be easily used in Kotlin, taking advantage of the many Kotlin language features such as for example:

@@ -2772,7 +2772,7 @@ import org.jooq.example.db.h2.Tables.* fun main(args: Array) { val properties = Properties(); - properties.load(javaClass().getResourceAsStream("/config.properties")); + properties.load(Properties::class.java.getResourceAsStream("/config.properties")); DSL.using( properties.getProperty("db.url"), @@ -2783,10 +2783,12 @@ fun main(args: Array) { // See also: https://github.com/JetBrains/kotlin/pull/807 ).use { val ctx = it + val a = AUTHOR + val b = BOOK - ctx.select(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, BOOK.TITLE) - .from(AUTHOR) - .join(BOOK).on(AUTHOR.ID.eq(BOOK.AUTHOR_ID)) + ctx.select(a.FIRST_NAME, a.LAST_NAME, b.TITLE) + .from(a) + .join(b).on(a.ID.eq(b.AUTHOR_ID)) .orderBy(1, 2, 3) .forEach { println("${it.value3()} by ${it.value1()} ${it.value2()}") @@ -15126,76 +15128,7 @@ public class Book {

Run generation with Gradle

- While some third-party Gradle plugins exist (e.g. the one by Etienne Studer from Gradleware), we generally recommend new users to use jOOQ's standalone code generator for simplicity. The following working example build.gradle script should work out of the box: -

- - -

- This example is frequently updated on GitHub: https://github.com/jOOQ/jOOQ/tree/master/jOOQ-examples/jOOQ-codegen-gradle + We recommend using the Gradle plugin by Etienne Studer from Gradle Inc.). It provides a concise DSL that allows you to tune all configuration properties supported by each jOOQ version.

diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml index 07f0304506..09093be48f 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml @@ -934,8 +934,8 @@ CREATE TABLE `author` ( test.generated - - C:/workspace/MySQLTest/src + + C:/workspace/MySQLTest/src/main/java ]]> @@ -2748,10 +2748,10 @@ DSL.using(sql.connection) jOOQ and Kotlin

- As any other library, jOOQ can be easily used in Groovy, taking advantage of the many Groovy language features such as for example: + As any other library, jOOQ can be easily used in Kotlin, taking advantage of the many Kotlin language features such as for example:

    -
  • Optional ";" at the end of a Groovy statement
  • +
  • Optional ";" at the end of a Kotlin statement
  • Type inference for local variables
@@ -2772,7 +2772,7 @@ import org.jooq.example.db.h2.Tables.* fun main(args: Array) { val properties = Properties(); - properties.load(javaClass().getResourceAsStream("/config.properties")); + properties.load(Properties::class.java.getResourceAsStream("/config.properties")); DSL.using( properties.getProperty("db.url"), @@ -2783,13 +2783,15 @@ fun main(args: Array) { // See also: https://github.com/JetBrains/kotlin/pull/807 ).use { val ctx = it + val a = AUTHOR + val b = BOOK - ctx.select(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, BOOK.TITLE) - .from(AUTHOR) - .join(BOOK).on(AUTHOR.ID.eq(BOOK.AUTHOR_ID)) + ctx.select(a.FIRST_NAME, a.LAST_NAME, b.TITLE) + .from(a) + .join(b).on(a.ID.eq(b.AUTHOR_ID)) .orderBy(1, 2, 3) .forEach { - println("${it.value3()} by ${it.value1()} ${it.value2()}") + println("${it[b.TITLE]} by ${it[a.FIRST_NAME]} ${it[a.LAST_NAME]}") } } }]]> @@ -15273,76 +15275,7 @@ public class Book {

Run generation with Gradle

- While some third-party Gradle plugins exist (e.g. the one by Etienne Studer from Gradleware), we generally recommend new users to use jOOQ's standalone code generator for simplicity. The following working example build.gradle script should work out of the box: -

- - -

- This example is frequently updated on GitHub: https://github.com/jOOQ/jOOQ/tree/master/jOOQ-examples/jOOQ-codegen-gradle + We recommend using the Gradle plugin by Etienne Studer from Gradle Inc.). It provides a concise DSL that allows you to tune all configuration properties supported by each jOOQ version.