From 2e3098af58aa983a36d248f2421e67e459af1b7a Mon Sep 17 00:00:00 2001 From: Vlad Mihalcea Date: Tue, 30 Jan 2024 15:28:42 +0200 Subject: [PATCH] Add support for Hibernate 6.4 #685 --- README.md | 4 ++-- hypersistence-utils-hibernate-63/pom.xml | 3 ++- .../type/array/internal/ArraySqlTypeDescriptor.java | 2 +- .../json/generic/GenericMySQLRegisterJsonTypeTest.java | 7 ------- .../hypersistence/utils/hibernate/type/model/Location.java | 7 +++---- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7a37e4a30..525115019 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ That's it! The Hypersistence Utils project gives you general-purpose utilities for both Spring and Hibernate. -The main advantage of this project is that it supports a broad range of Hibernate versions, spanning from **Hibernate ORM 6.3**, **6.2** to **6.1**, **6.0**, **5.6**, **5.5**, **5.4**, **5.3**, and Hibernate **5.2**. +The main advantage of this project is that it supports a broad range of Hibernate versions, spanning from **Hibernate ORM 6.4**, **6.3** to **6.2**, **6.1**, **6.0**, **5.6**, **5.5**, **5.4**, **5.3**, and Hibernate **5.2**. ### Installation Guide Depending on the Hibernate version you are using, you need to add the following dependency: -#### Hibernate 6.3 +#### Hibernate 6.4 and 6.3 io.hypersistence diff --git a/hypersistence-utils-hibernate-63/pom.xml b/hypersistence-utils-hibernate-63/pom.xml index de0c6f950..8d635f92c 100644 --- a/hypersistence-utils-hibernate-63/pom.xml +++ b/hypersistence-utils-hibernate-63/pom.xml @@ -202,7 +202,8 @@ ${jdk.version} ${jdk-test.version} - 6.3.1.Final + + 6.4.2.Final 2.15.3 32.1.3-jre diff --git a/hypersistence-utils-hibernate-63/src/main/java/io/hypersistence/utils/hibernate/type/array/internal/ArraySqlTypeDescriptor.java b/hypersistence-utils-hibernate-63/src/main/java/io/hypersistence/utils/hibernate/type/array/internal/ArraySqlTypeDescriptor.java index ec5ee30b9..4aa657c34 100644 --- a/hypersistence-utils-hibernate-63/src/main/java/io/hypersistence/utils/hibernate/type/array/internal/ArraySqlTypeDescriptor.java +++ b/hypersistence-utils-hibernate-63/src/main/java/io/hypersistence/utils/hibernate/type/array/internal/ArraySqlTypeDescriptor.java @@ -19,7 +19,7 @@ public class ArraySqlTypeDescriptor implements JdbcType { @Override public int getJdbcTypeCode() { - return Types.ARRAY; + return Types.OTHER; } @Override diff --git a/hypersistence-utils-hibernate-63/src/test/java/io/hypersistence/utils/hibernate/type/json/generic/GenericMySQLRegisterJsonTypeTest.java b/hypersistence-utils-hibernate-63/src/test/java/io/hypersistence/utils/hibernate/type/json/generic/GenericMySQLRegisterJsonTypeTest.java index 9ce7e4d50..f7fa32230 100644 --- a/hypersistence-utils-hibernate-63/src/test/java/io/hypersistence/utils/hibernate/type/json/generic/GenericMySQLRegisterJsonTypeTest.java +++ b/hypersistence-utils-hibernate-63/src/test/java/io/hypersistence/utils/hibernate/type/json/generic/GenericMySQLRegisterJsonTypeTest.java @@ -1,9 +1,6 @@ package io.hypersistence.utils.hibernate.type.json.generic; -import io.hypersistence.utils.hibernate.type.json.JsonBinaryType; import io.hypersistence.utils.hibernate.type.json.JsonType; -import io.hypersistence.utils.hibernate.type.json.configuration.CustomObjectMapperSupplier; -import io.hypersistence.utils.hibernate.type.json.configuration.PostgreSQLJsonBinaryTypeProgrammaticConfigurationTest; import io.hypersistence.utils.hibernate.type.model.BaseEntity; import io.hypersistence.utils.hibernate.type.model.Location; import io.hypersistence.utils.hibernate.type.model.Ticket; @@ -15,13 +12,9 @@ import jakarta.persistence.Table; import org.hibernate.annotations.Type; import org.hibernate.jpa.boot.spi.TypeContributorList; -import org.hibernate.query.NativeQuery; -import org.hibernate.query.Query; -import org.hibernate.query.TypedParameterValue; import org.junit.Test; import java.util.Collections; -import java.util.List; import java.util.Properties; import static org.junit.Assert.assertEquals; diff --git a/hypersistence-utils-hibernate-63/src/test/java/io/hypersistence/utils/hibernate/type/model/Location.java b/hypersistence-utils-hibernate-63/src/test/java/io/hypersistence/utils/hibernate/type/model/Location.java index 54d7aacda..1ba5d7152 100644 --- a/hypersistence-utils-hibernate-63/src/test/java/io/hypersistence/utils/hibernate/type/model/Location.java +++ b/hypersistence-utils-hibernate-63/src/test/java/io/hypersistence/utils/hibernate/type/model/Location.java @@ -1,5 +1,7 @@ package io.hypersistence.utils.hibernate.type.model; +import io.hypersistence.utils.hibernate.type.json.internal.JacksonUtil; + import java.io.Serializable; import java.util.Objects; @@ -30,10 +32,7 @@ public void setCity(String city) { @Override public String toString() { - return "Location{" + - "country='" + country + '\'' + - ", city='" + city + '\'' + - '}'; + return JacksonUtil.toString(this); } @Override