Skip to content

Commit 89ec95d

Browse files
committed
[#1626] Update and re-enable the jbang based examples
1 parent 8ab4ac8 commit 89ec95d

7 files changed

+47
-46
lines changed

tooling/jbang/CockroachDBReactiveTest.java.qute

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* Copyright: Red Hat Inc. and Hibernate Authors
66
*/
77

8-
//DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.3.8}
9-
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.3.8}
10-
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:1.1.9.Final}
8+
//DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.4.2}
9+
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.4.2}
10+
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.0.Final}
1111
//DEPS org.assertj:assertj-core:3.24.2
1212
//DEPS junit:junit:4.13.2
1313
//DEPS org.testcontainers:cockroachdb:1.18.0
14-
//DEPS org.slf4j:slf4j-simple:1.7.30
14+
//DEPS org.slf4j:slf4j-simple:2.0.7
1515

1616
//// Testcontainer needs the JDBC drivers to start the container
1717
//// Hibernate Reactive doesn't need it

tooling/jbang/Db2ReactiveTest.java.qute

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* Copyright: Red Hat Inc. and Hibernate Authors
66
*/
77

8-
//DEPS io.vertx:vertx-db2-client:$\{vertx.version:4.3.8}
9-
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.3.8}
10-
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:1.1.9.Final}
8+
//DEPS io.vertx:vertx-db2-client:$\{vertx.version:4.4.2}
9+
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.4.2}
10+
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.0.Final}
1111
//DEPS org.assertj:assertj-core:3.24.2
1212
//DEPS junit:junit:4.13.2
1313
//DEPS org.testcontainers:db2:1.18.0
14-
//DEPS org.slf4j:slf4j-simple:1.7.30
14+
//DEPS org.slf4j:slf4j-simple:2.0.7
1515

1616
import jakarta.persistence.Entity;
1717
import jakarta.persistence.Id;

tooling/jbang/Example.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
* Copyright: Red Hat Inc. and Hibernate Authors
66
*/
77

8-
//DEPS io.vertx:vertx-pg-client:${vertx.version:4.3.8}
9-
//DEPS io.vertx:vertx-mysql-client:${vertx.version:4.3.8}
10-
//DEPS io.vertx:vertx-db2-client:${vertx.version:4.3.8}
11-
//DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:1.1.9.Final}
12-
//DEPS org.slf4j:slf4j-simple:1.7.30
13-
//DESCRIPTION Allow authentication to PostgreSQL using SCRAM:
148
//DEPS com.ongres.scram:client:2.1
9+
//DEPS io.vertx:vertx-pg-client:${vertx.version:4.4.2}
10+
//DEPS io.vertx:vertx-mysql-client:${vertx.version:4.4.2}
11+
//DEPS io.vertx:vertx-db2-client:${vertx.version:4.4.2}
12+
//DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:2.0.0.Final}
13+
//DEPS org.slf4j:slf4j-simple:2.0.7
14+
//DESCRIPTION Allow authentication to PostgreSQL using SCRAM:
1515

1616
import java.time.LocalDate;
1717
import java.util.ArrayList;
1818
import java.util.List;
19+
1920
import jakarta.persistence.Basic;
2021
import jakarta.persistence.Entity;
2122
import jakarta.persistence.GeneratedValue;
@@ -58,7 +59,7 @@
5859
* <pre>
5960
* podman run --rm --name HibernateTestingPGSQL \
6061
* -e POSTGRES_USER=hreact -e POSTGRES_PASSWORD=hreact -e POSTGRES_DB=hreact \
61-
* -p 5432:5432 postgres:14
62+
* -p 5432:5432 postgres:15.2
6263
* </pre>
6364
* </dd>
6465
* <dt>3. Run the example with JBang</dt>
@@ -136,23 +137,23 @@ public static void main(String[] args) {
136137
try (Mutiny.SessionFactory factory = createSessionFactory()) {
137138
// obtain a reactive session
138139
factory.withTransaction(
139-
// persist the Authors with their Books in a transaction
140-
(session, tx) -> session.persistAll( author1, author2 )
141-
)
140+
// persist the Authors with their Books in a transaction
141+
(session, tx) -> session.persistAll( author1, author2 )
142+
)
142143
// wait for it to finish
143144
.await().indefinitely();
144145

145146
out.println();
146147
out.println( "Looking for the book \"" + book1.getTitle() + "\"..." );
147148
factory.withSession(
148-
// retrieve a Book
149-
session -> session.find( Book.class, book1.getId() )
150-
// author is a lazy association, we need to fetch it first if we want to use it
151-
.chain( book -> session.fetch( book.getAuthor() )
152-
// print its title and author
153-
.invoke( author -> out.println( "FOUND: \"" + book.getTitle() + "\"" + " by " + author.getName() + " is a great book!" ) )
154-
)
155-
)
149+
// retrieve a Book
150+
session -> session.find( Book.class, book1.getId() )
151+
// author is a lazy association, we need to fetch it first if we want to use it
152+
.chain( book -> session.fetch( book.getAuthor() )
153+
// print its title and author
154+
.invoke( author -> out.println( "FOUND: \"" + book.getTitle() + "\"" + " by " + author.getName() + " is a great book!" ) )
155+
)
156+
)
156157
// wait for it to finish
157158
.await().indefinitely();
158159
}

tooling/jbang/MariaDBReactiveTest.java.qute

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
* Copyright: Red Hat Inc. and Hibernate Authors
66
*/
77

8-
//DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.3.8}
9-
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.3.8}
10-
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:1.1.9.Final}
8+
//DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.4.2}
9+
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.4.2}
10+
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.0.Final}
1111
//DEPS org.assertj:assertj-core:3.24.2
1212
//DEPS junit:junit:4.13.2
1313
//DEPS org.testcontainers:mariadb:1.18.0
14-
//DEPS org.slf4j:slf4j-simple:1.7.30
14+
//DEPS org.slf4j:slf4j-simple:2.0.7
1515

1616
//// Testcontainer needs the JDBC drivers to start the container
1717
//// Hibernate Reactive doesn't need it
18-
//DEPS org.mariadb.jdbc:mariadb-java-client:2.7.3
18+
//DEPS org.mariadb.jdbc:mariadb-java-client:3.1.4
1919

2020
import jakarta.persistence.Entity;
2121
import jakarta.persistence.Id;

tooling/jbang/MySQLReactiveTest.java.qute

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* Copyright: Red Hat Inc. and Hibernate Authors
66
*/
77

8-
//DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.3.8}
9-
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.3.8}
10-
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:1.1.9.Final}
8+
//DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.4.2}
9+
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.4.2}
10+
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.0.Final}
1111
//DEPS org.assertj:assertj-core:3.24.2
1212
//DEPS junit:junit:4.13.2
1313
//DEPS org.testcontainers:mysql:1.18.0
14-
//DEPS org.slf4j:slf4j-simple:1.7.30
14+
//DEPS org.slf4j:slf4j-simple:2.0.7
1515

1616
//// Testcontainer needs the JDBC drivers to start the container
1717
//// Hibernate Reactive doesn't need it

tooling/jbang/PostgreSQLReactiveTest.java.qute

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* Copyright: Red Hat Inc. and Hibernate Authors
66
*/
77

8-
//DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.3.8}
9-
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.3.8}
10-
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:1.1.9.Final}
8+
//DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.4.2}
9+
//DEPS io.vertx:vertx-unit:$\{vertx.version:4.4.2}
10+
//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.0.Final}
1111
//DEPS org.assertj:assertj-core:3.24.2
1212
//DEPS junit:junit:4.13.2
1313
//DEPS org.testcontainers:postgresql:1.18.0
14-
//DEPS org.slf4j:slf4j-simple:1.7.30
14+
//DEPS org.slf4j:slf4j-simple:2.0.7
1515
//DESCRIPTION Allow authentication to PostgreSQL using SCRAM:
1616
//DEPS com.ongres.scram:client:2.1
1717

tooling/jbang/ReactiveTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
*/
66

77
///usr/bin/env jbang "$0" "$@" ; exit $?
8-
//DEPS io.vertx:vertx-pg-client:${vertx.version:4.3.8}
8+
//DEPS io.vertx:vertx-pg-client:${vertx.version:4.4.2}
99
//DEPS com.ongres.scram:client:2.1
10-
//DEPS io.vertx:vertx-db2-client:${vertx.version:4.3.8}
11-
//DEPS io.vertx:vertx-mysql-client:${vertx.version:4.3.8}
12-
//DEPS io.vertx:vertx-unit:${vertx.version:4.3.8}
13-
//DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:1.1.9.Final}
10+
//DEPS io.vertx:vertx-db2-client:${vertx.version:4.4.2}
11+
//DEPS io.vertx:vertx-mysql-client:${vertx.version:4.4.2}
12+
//DEPS io.vertx:vertx-unit:${vertx.version:4.4.2}
13+
//DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:2.0.0.Final}
1414
//DEPS org.assertj:assertj-core:3.24.2
1515
//DEPS junit:junit:4.13.2
1616
//DEPS org.testcontainers:postgresql:1.18.0
@@ -22,8 +22,8 @@
2222
//// Testcontainer needs the JDBC drivers to start the containers
2323
//// Hibernate Reactive doesn't use them
2424
//DEPS org.postgresql:postgresql:42.5.0
25-
//DEPS com.mysql:mysql-connector-j:8.0.32
26-
//DEPS org.mariadb.jdbc:mariadb-java-client:2.7.3
25+
//DEPS com.mysql:mysql-connector-j:8.0.33
26+
//DEPS org.mariadb.jdbc:mariadb-java-client:3.1.4
2727
//
2828

2929
import java.util.function.Supplier;

0 commit comments

Comments
 (0)