diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo12StoredProcedures.java b/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo12StoredProcedures.java index 044b40e..58283ad 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo12StoredProcedures.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo12StoredProcedures.java @@ -16,6 +16,10 @@ public class Demo12StoredProcedures extends AbstractDemo { @Test public void procedures() { + // Calling stored procedures and functions ("routines") is very easy with jOOQ and its code generator. Every + // routine has a corresponding generated stub in Java, which you can call with a Configuration, and jOOQ will + // take care of binding all the IN/OUT parameters. + title("Standalone procedure calls require a configuration argument"); println("Inventory 1 in stock: " + Routines.inventoryInStock(configuration, 1L)); @@ -35,6 +39,19 @@ public void procedures() { .orderBy(FILM.FILM_ID, STORE.STORE_ID) .limit(10) .fetch(); + + // More information here: + // - https://www.jooq.org/doc/latest/manual/code-generation/codegen-procedures/ + // - https://www.jooq.org/doc/latest/manual/sql-execution/stored-procedures/ + // + // And also various use-cases described in these blog posts: + // - https://blog.jooq.org/the-best-way-to-call-stored-procedures-from-java-with-jooq/ + // - https://blog.jooq.org/calling-procedures-with-default-parameters-using-jdbc-or-jooq/ + // - https://blog.jooq.org/postgresqls-table-valued-functions/ + // - https://blog.jooq.org/access-pl-sql-procedures-from-java-with-jooq-a-jpublisher-alternative/ + // - https://blog.jooq.org/use-jooq-to-read-write-oracle-plsql-record-types/ + // - https://blog.jooq.org/using-oracle-aq-in-java-wont-get-any-easier-than-this/ + // - https://blog.jooq.org/how-to-pass-a-table-valued-parameter-to-a-t-sql-function-with-jooq/ } @Test @@ -55,6 +72,9 @@ public void proceduralLanguage() { // // ctx.selectFrom(ACTOR).where(ACTOR.ACTOR_ID.gt(200L)).fetch(); // + + // More information here: + // - https://www.jooq.org/doc/latest/manual/sql-building/procedural-statements/ } @After diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo12StoredProcedures.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo12StoredProcedures.kt index 705500b..b7267db 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo12StoredProcedures.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo12StoredProcedures.kt @@ -17,6 +17,10 @@ class Demo12StoredProcedures : AbstractDemo() { @Test fun procedures() { + // Calling stored procedures and functions ("routines") is very easy with jOOQ and its code generator. Every + // routine has a corresponding generated stub in Java, which you can call with a Configuration, and jOOQ will + // take care of binding all the IN/OUT parameters. + title("Standalone procedure calls require a configuration argument") println("Inventory 1 in stock: " + inventoryInStock(configuration, 1L)) @@ -44,6 +48,19 @@ class Demo12StoredProcedures : AbstractDemo() { .orderBy(STORE.STORE_ID) .limit(10) .fetch() + + // More information here: + // - https://www.jooq.org/doc/latest/manual/code-generation/codegen-procedures/ + // - https://www.jooq.org/doc/latest/manual/sql-execution/stored-procedures/ + // + // And also various use-cases described in these blog posts: + // - https://blog.jooq.org/the-best-way-to-call-stored-procedures-from-java-with-jooq/ + // - https://blog.jooq.org/calling-procedures-with-default-parameters-using-jdbc-or-jooq/ + // - https://blog.jooq.org/postgresqls-table-valued-functions/ + // - https://blog.jooq.org/access-pl-sql-procedures-from-java-with-jooq-a-jpublisher-alternative/ + // - https://blog.jooq.org/use-jooq-to-read-write-oracle-plsql-record-types/ + // - https://blog.jooq.org/using-oracle-aq-in-java-wont-get-any-easier-than-this/ + // - https://blog.jooq.org/how-to-pass-a-table-valued-parameter-to-a-t-sql-function-with-jooq/ } @@ -67,6 +84,9 @@ class Demo12StoredProcedures : AbstractDemo() { // .where(ACTOR.ACTOR_ID.gt(200L)) // .fetch() // + + // More information here: + // - https://www.jooq.org/doc/latest/manual/sql-building/procedural-statements/ } @After diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo12StoredProcedures.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo12StoredProcedures.scala index ea67790..ca2187a 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo12StoredProcedures.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo12StoredProcedures.scala @@ -15,6 +15,10 @@ class Demo12StoredProcedures extends AbstractDemo { @Test def procedures(): Unit = { + // Calling stored procedures and functions ("routines") is very easy with jOOQ and its code generator. Every + // routine has a corresponding generated stub in Java, which you can call with a Configuration, and jOOQ will + // take care of binding all the IN/OUT parameters. + title("Standalone procedure calls require a configuration argument") println("Inventory 1 in stock: " + Routines.inventoryInStock(configuration, 1L)) @@ -37,11 +41,25 @@ class Demo12StoredProcedures extends AbstractDemo { .orderBy(FILM.FILM_ID, STORE.STORE_ID) .limit(10) .fetch + + // More information here: + // - https://www.jooq.org/doc/latest/manual/code-generation/codegen-procedures/ + // - https://www.jooq.org/doc/latest/manual/sql-execution/stored-procedures/ + // + // And also various use-cases described in these blog posts: + // - https://blog.jooq.org/the-best-way-to-call-stored-procedures-from-java-with-jooq/ + // - https://blog.jooq.org/calling-procedures-with-default-parameters-using-jdbc-or-jooq/ + // - https://blog.jooq.org/postgresqls-table-valued-functions/ + // - https://blog.jooq.org/access-pl-sql-procedures-from-java-with-jooq-a-jpublisher-alternative/ + // - https://blog.jooq.org/use-jooq-to-read-write-oracle-plsql-record-types/ + // - https://blog.jooq.org/using-oracle-aq-in-java-wont-get-any-easier-than-this/ + // - https://blog.jooq.org/how-to-pass-a-table-valued-parameter-to-a-t-sql-function-with-jooq/ } @Test def proceduralLanguage(): Unit = { title("The procedural language API allows for creating procedures or anonymous blocks") + // This is a commercial only feature. Check out the commercial demo for details // val i = `var`("i", BIGINT) @@ -53,6 +71,9 @@ class Demo12StoredProcedures extends AbstractDemo { // .execute // ctx.selectFrom(ACTOR).where(ACTOR.ACTOR_ID.gt(200L)).fetch // + + // More information here: + // - https://www.jooq.org/doc/latest/manual/sql-building/procedural-statements/ } @After diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo12StoredProcedures.java b/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo12StoredProcedures.java index 26a5b80..8e6bb0b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo12StoredProcedures.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo12StoredProcedures.java @@ -16,6 +16,10 @@ public class Demo12StoredProcedures extends AbstractDemo { @Test public void procedures() { + // Calling stored procedures and functions ("routines") is very easy with jOOQ and its code generator. Every + // routine has a corresponding generated stub in Java, which you can call with a Configuration, and jOOQ will + // take care of binding all the IN/OUT parameters. + title("Standalone procedure calls require a configuration argument"); println("Inventory 1 in stock: " + Routines.inventoryInStock(configuration, 1L)); @@ -35,6 +39,19 @@ public void procedures() { .orderBy(FILM.FILM_ID, STORE.STORE_ID) .limit(10) .fetch(); + + // More information here: + // - https://www.jooq.org/doc/latest/manual/code-generation/codegen-procedures/ + // - https://www.jooq.org/doc/latest/manual/sql-execution/stored-procedures/ + // + // And also various use-cases described in these blog posts: + // - https://blog.jooq.org/the-best-way-to-call-stored-procedures-from-java-with-jooq/ + // - https://blog.jooq.org/calling-procedures-with-default-parameters-using-jdbc-or-jooq/ + // - https://blog.jooq.org/postgresqls-table-valued-functions/ + // - https://blog.jooq.org/access-pl-sql-procedures-from-java-with-jooq-a-jpublisher-alternative/ + // - https://blog.jooq.org/use-jooq-to-read-write-oracle-plsql-record-types/ + // - https://blog.jooq.org/using-oracle-aq-in-java-wont-get-any-easier-than-this/ + // - https://blog.jooq.org/how-to-pass-a-table-valued-parameter-to-a-t-sql-function-with-jooq/ } @Test @@ -55,6 +72,9 @@ public void proceduralLanguage() { ctx.selectFrom(ACTOR).where(ACTOR.ACTOR_ID.gt(200L)).fetch(); /* [/pro] */ + + // More information here: + // - https://www.jooq.org/doc/latest/manual/sql-building/procedural-statements/ } @After diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo12StoredProcedures.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo12StoredProcedures.kt index 0b64162..289655c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo12StoredProcedures.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo12StoredProcedures.kt @@ -17,6 +17,10 @@ class Demo12StoredProcedures : AbstractDemo() { @Test fun procedures() { + // Calling stored procedures and functions ("routines") is very easy with jOOQ and its code generator. Every + // routine has a corresponding generated stub in Java, which you can call with a Configuration, and jOOQ will + // take care of binding all the IN/OUT parameters. + title("Standalone procedure calls require a configuration argument") println("Inventory 1 in stock: " + inventoryInStock(configuration, 1L)) @@ -44,6 +48,19 @@ class Demo12StoredProcedures : AbstractDemo() { .orderBy(STORE.STORE_ID) .limit(10) .fetch() + + // More information here: + // - https://www.jooq.org/doc/latest/manual/code-generation/codegen-procedures/ + // - https://www.jooq.org/doc/latest/manual/sql-execution/stored-procedures/ + // + // And also various use-cases described in these blog posts: + // - https://blog.jooq.org/the-best-way-to-call-stored-procedures-from-java-with-jooq/ + // - https://blog.jooq.org/calling-procedures-with-default-parameters-using-jdbc-or-jooq/ + // - https://blog.jooq.org/postgresqls-table-valued-functions/ + // - https://blog.jooq.org/access-pl-sql-procedures-from-java-with-jooq-a-jpublisher-alternative/ + // - https://blog.jooq.org/use-jooq-to-read-write-oracle-plsql-record-types/ + // - https://blog.jooq.org/using-oracle-aq-in-java-wont-get-any-easier-than-this/ + // - https://blog.jooq.org/how-to-pass-a-table-valued-parameter-to-a-t-sql-function-with-jooq/ } @@ -67,6 +84,9 @@ class Demo12StoredProcedures : AbstractDemo() { .where(ACTOR.ACTOR_ID.gt(200L)) .fetch() /* [/pro] */ + + // More information here: + // - https://www.jooq.org/doc/latest/manual/sql-building/procedural-statements/ } @After diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo12StoredProcedures.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo12StoredProcedures.scala index 4604376..3de117b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo12StoredProcedures.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo12StoredProcedures.scala @@ -15,6 +15,10 @@ class Demo12StoredProcedures extends AbstractDemo { @Test def procedures(): Unit = { + // Calling stored procedures and functions ("routines") is very easy with jOOQ and its code generator. Every + // routine has a corresponding generated stub in Java, which you can call with a Configuration, and jOOQ will + // take care of binding all the IN/OUT parameters. + title("Standalone procedure calls require a configuration argument") println("Inventory 1 in stock: " + Routines.inventoryInStock(configuration, 1L)) @@ -37,11 +41,25 @@ class Demo12StoredProcedures extends AbstractDemo { .orderBy(FILM.FILM_ID, STORE.STORE_ID) .limit(10) .fetch + + // More information here: + // - https://www.jooq.org/doc/latest/manual/code-generation/codegen-procedures/ + // - https://www.jooq.org/doc/latest/manual/sql-execution/stored-procedures/ + // + // And also various use-cases described in these blog posts: + // - https://blog.jooq.org/the-best-way-to-call-stored-procedures-from-java-with-jooq/ + // - https://blog.jooq.org/calling-procedures-with-default-parameters-using-jdbc-or-jooq/ + // - https://blog.jooq.org/postgresqls-table-valued-functions/ + // - https://blog.jooq.org/access-pl-sql-procedures-from-java-with-jooq-a-jpublisher-alternative/ + // - https://blog.jooq.org/use-jooq-to-read-write-oracle-plsql-record-types/ + // - https://blog.jooq.org/using-oracle-aq-in-java-wont-get-any-easier-than-this/ + // - https://blog.jooq.org/how-to-pass-a-table-valued-parameter-to-a-t-sql-function-with-jooq/ } @Test def proceduralLanguage(): Unit = { title("The procedural language API allows for creating procedures or anonymous blocks") + // This is a commercial only feature. Check out the commercial demo for details /* [pro] */ val i = `var`("i", BIGINT) @@ -53,6 +71,9 @@ class Demo12StoredProcedures extends AbstractDemo { .execute ctx.selectFrom(ACTOR).where(ACTOR.ACTOR_ID.gt(200L)).fetch /* [/pro] */ + + // More information here: + // - https://www.jooq.org/doc/latest/manual/sql-building/procedural-statements/ } @After