From 169b9abeef7079518739a9a7b123cab25297705d Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Fri, 9 Feb 2024 22:27:14 -0500 Subject: [PATCH 1/2] Fixes syntax error in JdbcClient examples See gh-32236 --- framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc index a427ecc5fe9..c780bac448a 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc @@ -759,7 +759,7 @@ With a required single object result: [source,java,indent=0,subs="verbatim,quotes"] ---- - Actor actor = this.jdbcClient.sql("select first_name, last_name from t_actor where id = ?", + Actor actor = this.jdbcClient.sql("select first_name, last_name from t_actor where id = ?") .param(1212L); .query(Actor.class) .single(); @@ -769,7 +769,7 @@ With a `java.util.Optional` result: [source,java,indent=0,subs="verbatim,quotes"] ---- - Optional actor = this.jdbcClient.sql("select first_name, last_name from t_actor where id = ?", + Optional actor = this.jdbcClient.sql("select first_name, last_name from t_actor where id = ?") .param(1212L); .query(Actor.class) .optional(); From b1f6401e4f02ead72958ea1dcc242451ce12fd2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Sat, 10 Feb 2024 09:04:44 +0100 Subject: [PATCH 2/2] Polish "Fixes syntax error in JdbcClient examples" See gh-32236 --- .../modules/ROOT/pages/data-access/jdbc/core.adoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc index c780bac448a..ce2aa6f47f7 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc @@ -717,7 +717,7 @@ For example, with positional parameters: public int countOfActorsByFirstName(String firstName) { return this.jdbcClient.sql("select count(*) from t_actor where first_name = ?") - .param(firstName); + .param(firstName) .query(Integer.class).single(); } ---- @@ -730,7 +730,7 @@ For example, with named parameters: public int countOfActorsByFirstName(String firstName) { return this.jdbcClient.sql("select count(*) from t_actor where first_name = :firstName") - .param("firstName", firstName); + .param("firstName", firstName) .query(Integer.class).single(); } ---- @@ -760,7 +760,7 @@ With a required single object result: [source,java,indent=0,subs="verbatim,quotes"] ---- Actor actor = this.jdbcClient.sql("select first_name, last_name from t_actor where id = ?") - .param(1212L); + .param(1212L) .query(Actor.class) .single(); ---- @@ -770,7 +770,7 @@ With a `java.util.Optional` result: [source,java,indent=0,subs="verbatim,quotes"] ---- Optional actor = this.jdbcClient.sql("select first_name, last_name from t_actor where id = ?") - .param(1212L); + .param(1212L) .query(Actor.class) .optional(); ---- @@ -780,7 +780,7 @@ And for an update statement: [source,java,indent=0,subs="verbatim,quotes"] ---- this.jdbcClient.sql("insert into t_actor (first_name, last_name) values (?, ?)") - .param("Leonor").param("Watling"); + .param("Leonor").param("Watling") .update(); ---- @@ -789,7 +789,7 @@ Or an update statement with named parameters: [source,java,indent=0,subs="verbatim,quotes"] ---- this.jdbcClient.sql("insert into t_actor (first_name, last_name) values (:firstName, :lastName)") - .param("firstName", "Leonor").param("lastName", "Watling"); + .param("firstName", "Leonor").param("lastName", "Watling") .update(); ---- @@ -800,7 +800,7 @@ provides `firstName` and `lastName` properties, such as the `Actor` class from a [source,java,indent=0,subs="verbatim,quotes"] ---- this.jdbcClient.sql("insert into t_actor (first_name, last_name) values (:firstName, :lastName)") - .paramSource(new Actor("Leonor", "Watling"); + .paramSource(new Actor("Leonor", "Watling") .update(); ----