From e218e72fa77fdabd8257a9bf91c998d84dff86af Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Fri, 15 Dec 2023 14:10:12 +0100 Subject: [PATCH 1/3] [#1820] Upgrade Vert.x to 4.5.1 --- README.md | 10 +++++----- build.gradle | 2 +- gradle.properties | 6 +++--- tooling/jbang/CockroachDBReactiveTest.java.qute | 4 ++-- tooling/jbang/Db2ReactiveTest.java.qute | 4 ++-- tooling/jbang/Example.java | 6 +++--- tooling/jbang/MariaDBReactiveTest.java.qute | 4 ++-- tooling/jbang/MySQLReactiveTest.java.qute | 4 ++-- tooling/jbang/PostgreSQLReactiveTest.java.qute | 4 ++-- tooling/jbang/ReactiveTest.java | 8 ++++---- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 6b59aaab1..3df5d4033 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,11 @@ Hibernate Reactive has been tested with: - MS SQL Server 2019 - Oracle 21.3 - [Hibernate ORM][] 6.4.0.Final -- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.0 -- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.0 -- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.0 -- [Vert.x Reactive MS SQL Server Client](https://vertx.io/docs/vertx-mssql-client/java/) 4.5.0 -- [Vert.x Reactive Oracle Client](https://vertx.io/docs/vertx-oracle-client/java/) 4.5.0 +- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.1 +- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.1 +- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.1 +- [Vert.x Reactive MS SQL Server Client](https://vertx.io/docs/vertx-mssql-client/java/) 4.5.1 +- [Vert.x Reactive Oracle Client](https://vertx.io/docs/vertx-oracle-client/java/) 4.5.1 - [Quarkus][Quarkus] via the Hibernate Reactive extension [PostgreSQL]: https://www.postgresql.org diff --git a/build.gradle b/build.gradle index bd64e2500..1ac93d309 100644 --- a/build.gradle +++ b/build.gradle @@ -83,7 +83,7 @@ ext { // Example: // ./gradlew build -PvertxSqlClientVersion=4.0.0-SNAPSHOT if ( !project.hasProperty( 'vertxSqlClientVersion' ) ) { - vertxSqlClientVersion = '4.5.0' + vertxSqlClientVersion = '4.5.1' } testcontainersVersion = '1.18.3' diff --git a/gradle.properties b/gradle.properties index 45eac1069..e6bc9462c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -47,9 +47,9 @@ org.gradle.java.installations.auto-download=false #skipOrmVersionParsing = true # Override default Vert.x Sql client version -#vertxSqlClientVersion = 4.5.0-SNAPSHOT +#vertxSqlClientVersion = 4.5.1-SNAPSHOT # Override default Vert.x Web client and server versions. For integration tests, both default to vertxSqlClientVersion -#vertxWebVersion = 4.5.0 -#vertxWebtClientVersion = 4.5.0 +#vertxWebVersion = 4.5.1 +#vertxWebtClientVersion = 4.5.1 diff --git a/tooling/jbang/CockroachDBReactiveTest.java.qute b/tooling/jbang/CockroachDBReactiveTest.java.qute index d42459250..b837b267a 100755 --- a/tooling/jbang/CockroachDBReactiveTest.java.qute +++ b/tooling/jbang/CockroachDBReactiveTest.java.qute @@ -5,8 +5,8 @@ * Copyright: Red Hat Inc. and Hibernate Authors */ -//DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.5.0} -//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.0} +//DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.5.1} +//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} //DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 diff --git a/tooling/jbang/Db2ReactiveTest.java.qute b/tooling/jbang/Db2ReactiveTest.java.qute index 7d6cfcf0e..c66d19910 100755 --- a/tooling/jbang/Db2ReactiveTest.java.qute +++ b/tooling/jbang/Db2ReactiveTest.java.qute @@ -5,8 +5,8 @@ * Copyright: Red Hat Inc. and Hibernate Authors */ -//DEPS io.vertx:vertx-db2-client:$\{vertx.version:4.5.0} -//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.0} +//DEPS io.vertx:vertx-db2-client:$\{vertx.version:4.5.1} +//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} //DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 diff --git a/tooling/jbang/Example.java b/tooling/jbang/Example.java index 0f9831235..727bd8018 100644 --- a/tooling/jbang/Example.java +++ b/tooling/jbang/Example.java @@ -6,9 +6,9 @@ */ //DEPS com.ongres.scram:client:2.1 -//DEPS io.vertx:vertx-pg-client:${vertx.version:4.5.0} -//DEPS io.vertx:vertx-mysql-client:${vertx.version:4.5.0} -//DEPS io.vertx:vertx-db2-client:${vertx.version:4.5.0} +//DEPS io.vertx:vertx-pg-client:${vertx.version:4.5.1} +//DEPS io.vertx:vertx-mysql-client:${vertx.version:4.5.1} +//DEPS io.vertx:vertx-db2-client:${vertx.version:4.5.1} //DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:2.0.5.Final} //DEPS org.slf4j:slf4j-simple:2.0.7 //DESCRIPTION Allow authentication to PostgreSQL using SCRAM: diff --git a/tooling/jbang/MariaDBReactiveTest.java.qute b/tooling/jbang/MariaDBReactiveTest.java.qute index 2c1537275..db62a8656 100755 --- a/tooling/jbang/MariaDBReactiveTest.java.qute +++ b/tooling/jbang/MariaDBReactiveTest.java.qute @@ -5,8 +5,8 @@ * Copyright: Red Hat Inc. and Hibernate Authors */ -//DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.5.0} -//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.0} +//DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.5.1} +//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} //DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 diff --git a/tooling/jbang/MySQLReactiveTest.java.qute b/tooling/jbang/MySQLReactiveTest.java.qute index 704a39f6d..5010f3a61 100755 --- a/tooling/jbang/MySQLReactiveTest.java.qute +++ b/tooling/jbang/MySQLReactiveTest.java.qute @@ -5,8 +5,8 @@ * Copyright: Red Hat Inc. and Hibernate Authors */ -//DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.5.0} -//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.0} +//DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.5.1} +//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} //DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 diff --git a/tooling/jbang/PostgreSQLReactiveTest.java.qute b/tooling/jbang/PostgreSQLReactiveTest.java.qute index 954a79715..39e0ec848 100755 --- a/tooling/jbang/PostgreSQLReactiveTest.java.qute +++ b/tooling/jbang/PostgreSQLReactiveTest.java.qute @@ -5,8 +5,8 @@ * Copyright: Red Hat Inc. and Hibernate Authors */ -//DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.5.0} -//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.0} +//DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.5.1} +//DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} //DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 diff --git a/tooling/jbang/ReactiveTest.java b/tooling/jbang/ReactiveTest.java index 3253b363f..8b3192be3 100755 --- a/tooling/jbang/ReactiveTest.java +++ b/tooling/jbang/ReactiveTest.java @@ -5,11 +5,11 @@ */ ///usr/bin/env jbang "$0" "$@" ; exit $? -//DEPS io.vertx:vertx-pg-client:${vertx.version:4.5.0} +//DEPS io.vertx:vertx-pg-client:${vertx.version:4.5.1} //DEPS com.ongres.scram:client:2.1 -//DEPS io.vertx:vertx-db2-client:${vertx.version:4.5.0} -//DEPS io.vertx:vertx-mysql-client:${vertx.version:4.5.0} -//DEPS io.vertx:vertx-unit:${vertx.version:4.5.0} +//DEPS io.vertx:vertx-db2-client:${vertx.version:4.5.1} +//DEPS io.vertx:vertx-mysql-client:${vertx.version:4.5.1} +//DEPS io.vertx:vertx-unit:${vertx.version:4.5.1} //DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:2.0.5.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 From 709268f936ad459a61e99deed38a3d0935473a62 Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Fri, 15 Dec 2023 14:12:31 +0100 Subject: [PATCH 2/3] [#1821] Upgrade Hibernate Reactive to 2.2.0.Final for JBang --- tooling/jbang/CockroachDBReactiveTest.java.qute | 2 +- tooling/jbang/Db2ReactiveTest.java.qute | 2 +- tooling/jbang/Example.java | 2 +- tooling/jbang/MariaDBReactiveTest.java.qute | 2 +- tooling/jbang/MySQLReactiveTest.java.qute | 2 +- tooling/jbang/PostgreSQLReactiveTest.java.qute | 2 +- tooling/jbang/ReactiveTest.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tooling/jbang/CockroachDBReactiveTest.java.qute b/tooling/jbang/CockroachDBReactiveTest.java.qute index b837b267a..6bd79e507 100755 --- a/tooling/jbang/CockroachDBReactiveTest.java.qute +++ b/tooling/jbang/CockroachDBReactiveTest.java.qute @@ -7,7 +7,7 @@ //DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.5.1} //DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} -//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} +//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.2.0.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 //DEPS org.testcontainers:cockroachdb:1.18.3 diff --git a/tooling/jbang/Db2ReactiveTest.java.qute b/tooling/jbang/Db2ReactiveTest.java.qute index c66d19910..9aa4723b6 100755 --- a/tooling/jbang/Db2ReactiveTest.java.qute +++ b/tooling/jbang/Db2ReactiveTest.java.qute @@ -7,7 +7,7 @@ //DEPS io.vertx:vertx-db2-client:$\{vertx.version:4.5.1} //DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} -//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} +//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.2.0.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 //DEPS org.testcontainers:db2:1.18.3 diff --git a/tooling/jbang/Example.java b/tooling/jbang/Example.java index 727bd8018..680f22c01 100644 --- a/tooling/jbang/Example.java +++ b/tooling/jbang/Example.java @@ -9,7 +9,7 @@ //DEPS io.vertx:vertx-pg-client:${vertx.version:4.5.1} //DEPS io.vertx:vertx-mysql-client:${vertx.version:4.5.1} //DEPS io.vertx:vertx-db2-client:${vertx.version:4.5.1} -//DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:2.0.5.Final} +//DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:2.2.0.Final} //DEPS org.slf4j:slf4j-simple:2.0.7 //DESCRIPTION Allow authentication to PostgreSQL using SCRAM: diff --git a/tooling/jbang/MariaDBReactiveTest.java.qute b/tooling/jbang/MariaDBReactiveTest.java.qute index db62a8656..23b4675ce 100755 --- a/tooling/jbang/MariaDBReactiveTest.java.qute +++ b/tooling/jbang/MariaDBReactiveTest.java.qute @@ -7,7 +7,7 @@ //DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.5.1} //DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} -//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} +//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.2.0.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 //DEPS org.testcontainers:mariadb:1.18.3 diff --git a/tooling/jbang/MySQLReactiveTest.java.qute b/tooling/jbang/MySQLReactiveTest.java.qute index 5010f3a61..6adf27020 100755 --- a/tooling/jbang/MySQLReactiveTest.java.qute +++ b/tooling/jbang/MySQLReactiveTest.java.qute @@ -7,7 +7,7 @@ //DEPS io.vertx:vertx-mysql-client:$\{vertx.version:4.5.1} //DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} -//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} +//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.2.0.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 //DEPS org.testcontainers:mysql:1.18.3 diff --git a/tooling/jbang/PostgreSQLReactiveTest.java.qute b/tooling/jbang/PostgreSQLReactiveTest.java.qute index 39e0ec848..c8c4dbff8 100755 --- a/tooling/jbang/PostgreSQLReactiveTest.java.qute +++ b/tooling/jbang/PostgreSQLReactiveTest.java.qute @@ -7,7 +7,7 @@ //DEPS io.vertx:vertx-pg-client:$\{vertx.version:4.5.1} //DEPS io.vertx:vertx-unit:$\{vertx.version:4.5.1} -//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.0.5.Final} +//DEPS org.hibernate.reactive:hibernate-reactive-core:$\{hibernate-reactive.version:2.2.0.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 //DEPS org.testcontainers:postgresql:1.18.3 diff --git a/tooling/jbang/ReactiveTest.java b/tooling/jbang/ReactiveTest.java index 8b3192be3..2cb7177e2 100755 --- a/tooling/jbang/ReactiveTest.java +++ b/tooling/jbang/ReactiveTest.java @@ -10,7 +10,7 @@ //DEPS io.vertx:vertx-db2-client:${vertx.version:4.5.1} //DEPS io.vertx:vertx-mysql-client:${vertx.version:4.5.1} //DEPS io.vertx:vertx-unit:${vertx.version:4.5.1} -//DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:2.0.5.Final} +//DEPS org.hibernate.reactive:hibernate-reactive-core:${hibernate-reactive.version:2.2.0.Final} //DEPS org.assertj:assertj-core:3.24.2 //DEPS junit:junit:4.13.2 //DEPS org.testcontainers:postgresql:1.18.3 From 60c383e07a09e3ed8ea3026163c3daa3ac50653c Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Fri, 15 Dec 2023 14:30:45 +0100 Subject: [PATCH 3/3] [#1819] Add tests for mapping of array of primitives fields Vert.x SQL client 4.5.1 fixes the issue with primitives type. This commit add the missing tests and tweak a bit the existing ones. --- .../reactive/types/JavaTypesArrayTest.java | 77 +++++++++++++++++-- 1 file changed, 69 insertions(+), 8 deletions(-) diff --git a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/types/JavaTypesArrayTest.java b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/types/JavaTypesArrayTest.java index a15811f2e..739fb18a0 100644 --- a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/types/JavaTypesArrayTest.java +++ b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/types/JavaTypesArrayTest.java @@ -19,7 +19,6 @@ import org.hibernate.reactive.BaseReactiveTest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIf; @@ -41,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; @Timeout(value = 10, timeUnit = MINUTES) -@DisabledIf( "isNotSupported" ) +@DisabledIf("isNotSupported") public class JavaTypesArrayTest extends BaseReactiveTest { @Override @@ -80,48 +79,93 @@ public void testStringArrayType(VertxTestContext context) { @Test public void testBooleanArrayType(VertxTestContext context) { Basic basic = new Basic(); - Boolean[] dataArray = {TRUE, FALSE, TRUE}; + Boolean[] dataArray = {TRUE, FALSE, null, TRUE}; basic.booleanArray = dataArray; testField( context, basic, found -> assertArrayEquals( dataArray, found.booleanArray ) ); } + @Test + public void testPrimitiveBooleanArrayType(VertxTestContext context) { + Basic basic = new Basic(); + boolean[] dataArray = {true, false, true}; + basic.primitiveBooleanArray = dataArray; + + testField( context, basic, found -> assertArrayEquals( dataArray, found.primitiveBooleanArray ) ); + } + @Test public void testIntegerArrayType(VertxTestContext context) { Basic basic = new Basic(); - Integer[] dataArray = {1, 2, 3}; + Integer[] dataArray = {null, Integer.MIN_VALUE, 2, Integer.MAX_VALUE}; basic.integerArray = dataArray; testField( context, basic, found -> assertArrayEquals( dataArray, found.integerArray ) ); } + @Test + public void testPrimitiveIntegerArrayType(VertxTestContext context) { + Basic basic = new Basic(); + int[] dataArray = {1, 2, 3}; + basic.primitiveIntegerArray = dataArray; + + testField( context, basic, found -> assertArrayEquals( dataArray, found.primitiveIntegerArray ) ); + } + @Test public void testLongArrayType(VertxTestContext context) { Basic basic = new Basic(); - Long[] dataArray = {Long.MIN_VALUE, Long.MAX_VALUE, 3L}; + Long[] dataArray = {Long.MIN_VALUE, Long.MAX_VALUE, 3L, null}; basic.longArray = dataArray; testField( context, basic, found -> assertArrayEquals( dataArray, found.longArray ) ); } + @Test + public void testPrimitiveLongArrayType(VertxTestContext context) { + Basic basic = new Basic(); + long[] dataArray = {Long.MIN_VALUE, Long.MAX_VALUE, 3L}; + basic.primitiveLongArray = dataArray; + + testField( context, basic, found -> assertArrayEquals( dataArray, found.primitiveLongArray ) ); + } + @Test public void testFloatArrayType(VertxTestContext context) { Basic basic = new Basic(); - Float[] dataArray = {12.562f, 13.562f}; + Float[] dataArray = {12.562f, null, 13.562f}; basic.floatArray = dataArray; testField( context, basic, found -> assertArrayEquals( dataArray, found.floatArray ) ); } + @Test + public void testPrimitiveFloatArrayType(VertxTestContext context) { + Basic basic = new Basic(); + float[] dataArray = {12.562f, 13.562f}; + basic.primitiveFloatArray = dataArray; + + testField( context, basic, found -> assertArrayEquals( dataArray, found.primitiveFloatArray ) ); + } + @Test public void testDoubleArrayType(VertxTestContext context) { Basic basic = new Basic(); - Double[] dataArray = {12.562d, 13.562d}; + Double[] dataArray = {12.562d, null, 13.562d}; basic.doubleArray = dataArray; testField( context, basic, found -> assertArrayEquals( dataArray, found.doubleArray ) ); } + @Test + public void testPrimitiveDoubleArrayType(VertxTestContext context) { + Basic basic = new Basic(); + double[] dataArray = {12.562d, 13.562d}; + basic.primitiveDoubleArray = dataArray; + + testField( context, basic, found -> assertArrayEquals( dataArray, found.primitiveDoubleArray ) ); + } + @Test public void testUUIDArrayType(VertxTestContext context) { Basic basic = new Basic(); @@ -153,6 +197,15 @@ public void testShortArrayType(VertxTestContext context) { testField( context, basic, found -> assertArrayEquals( dataArray, found.shortArray ) ); } + @Test + public void testPrimitiveShortArrayType(VertxTestContext context) { + Basic basic = new Basic(); + short[] dataArray = {500, 32, -1}; + basic.primitiveShortArray = dataArray; + + testField( context, basic, found -> assertArrayEquals( dataArray, found.primitiveShortArray ) ); + } + @Test public void testLocalDateArrayType(VertxTestContext context) { Basic basic = new Basic(); @@ -238,18 +291,26 @@ private static class Basic { Integer id; String[] stringArray; Boolean[] booleanArray; - + boolean[] primitiveBooleanArray; Integer[] integerArray; + int[] primitiveIntegerArray; Long[] longArray; + long[] primitiveLongArray; Float[] floatArray; + float[] primitiveFloatArray; Double[] doubleArray; + double[] primitiveDoubleArray; UUID[] uuidArray; AnEnum[] enumArray; Short[] shortArray; + short[] primitiveShortArray; Date[] dateArray; LocalDate[] localDateArray; LocalTime[] localTimeArray; LocalDateTime[] localDateTimeArray; + + // We have to specify the length for BigDecimal and BigInteger because + // the default column type when creating the schema is too small on some databases @Column(length = 5000) BigInteger[] bigIntegerArray; @Column(length = 5000)