From c2b6c314ca04902368b832b55a9f571c7afb58a5 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Sat, 26 Oct 2024 15:04:09 +0200 Subject: [PATCH] [#1927] Fix support for Hibernate ORM 6.6 --- .github/workflows/ci.yaml | 2 +- .github/workflows/latest.yaml | 2 +- core/testsuite-hibernate6/pom.xml | 2 +- core/testsuite-jakarta-runner/pom.xml | 2 +- core/testsuite/pom.xml | 2 +- entity-view/testsuite-jakarta-runner/pom.xml | 2 +- entity-view/testsuite/pom.xml | 2 +- .../singleton/SingletonCollectionsTest.java | 4 ++ .../entity/EmbeddedMappingEntityTest.java | 4 ++ ...ateUpdatableOnlyEntityCollectionsTest.java | 2 +- ...ViewUpdateUpdatableOnlyEntityMapsTest.java | 2 +- integration/deltaspike-data/testsuite/pom.xml | 2 +- .../base/HibernateExtendedQuerySupport.java | 14 ----- .../HibernateJpqlFunctionAdapter.java | 2 +- ...HibernateSqmFunctionDescriptorAdapter.java | 58 ++++++++++++++++--- integration/quarkus-3/deployment/pom.xml | 2 +- integration/querydsl/testsuite/pom.xml | 2 +- .../spring-data/testsuite/webflux/pom.xml | 2 +- .../spring-data/testsuite/webmvc/pom.xml | 2 +- jpa-criteria/testsuite-jakarta-runner/pom.xml | 2 +- jpa-criteria/testsuite/pom.xml | 2 +- parent/pom.xml | 2 +- .../base/AbstractPersistenceTest.java | 2 + .../base/AbstractPersistenceTest.java | 5 ++ .../base/jpa/AbstractJpaPersistenceTest.java | 4 ++ .../base/jpa/category/NoHibernate66.java | 21 +++++++ 26 files changed, 107 insertions(+), 41 deletions(-) create mode 100644 testsuite-base/jpa/src/main/java/com/blazebit/persistence/testsuite/base/jpa/category/NoHibernate66.java diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d5c8dbdc40..fed321712f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -688,7 +688,7 @@ jobs: shell: bash - name: Upload test reports (if Maven failed) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: test-reports-${{ matrix.provider }}-${{ matrix.rdbms }}-jdk${{ matrix.jdk }}-build-jdk${{ matrix.build-jdk }}-${{ matrix.deltaspike }}-${{ matrix.spring-data }} diff --git a/.github/workflows/latest.yaml b/.github/workflows/latest.yaml index 256820a895..87c5594048 100644 --- a/.github/workflows/latest.yaml +++ b/.github/workflows/latest.yaml @@ -99,7 +99,7 @@ jobs: shell: bash - name: Upload test reports (if Maven failed) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: test-reports-${{ matrix.component }} diff --git a/core/testsuite-hibernate6/pom.xml b/core/testsuite-hibernate6/pom.xml index 7a0d282711..250df5fd82 100644 --- a/core/testsuite-hibernate6/pom.xml +++ b/core/testsuite-hibernate6/pom.xml @@ -780,7 +780,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/core/testsuite-jakarta-runner/pom.xml b/core/testsuite-jakarta-runner/pom.xml index f0cbf853fd..a665921618 100644 --- a/core/testsuite-jakarta-runner/pom.xml +++ b/core/testsuite-jakarta-runner/pom.xml @@ -728,7 +728,7 @@ hibernate-6.6 ${version.jakarta-jpa-3.1-api} - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/core/testsuite/pom.xml b/core/testsuite/pom.xml index bccb8153c3..0ffe0503a4 100644 --- a/core/testsuite/pom.xml +++ b/core/testsuite/pom.xml @@ -2597,7 +2597,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 src/main/hibernate diff --git a/entity-view/testsuite-jakarta-runner/pom.xml b/entity-view/testsuite-jakarta-runner/pom.xml index 6e29f24aec..280011db34 100644 --- a/entity-view/testsuite-jakarta-runner/pom.xml +++ b/entity-view/testsuite-jakarta-runner/pom.xml @@ -740,7 +740,7 @@ hibernate-6.6 ${version.jakarta-jpa-3.1-api} - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/entity-view/testsuite/pom.xml b/entity-view/testsuite/pom.xml index 0c678a9b50..74d60b2a53 100644 --- a/entity-view/testsuite/pom.xml +++ b/entity-view/testsuite/pom.xml @@ -1912,7 +1912,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/collections/singleton/SingletonCollectionsTest.java b/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/collections/singleton/SingletonCollectionsTest.java index d4cba95b2b..4e51d7dd92 100644 --- a/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/collections/singleton/SingletonCollectionsTest.java +++ b/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/collections/singleton/SingletonCollectionsTest.java @@ -17,6 +17,7 @@ package com.blazebit.persistence.view.testsuite.collections.singleton; import com.blazebit.persistence.CriteriaBuilder; +import com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66; import com.blazebit.persistence.testsuite.tx.TxVoidWork; import com.blazebit.persistence.view.EntityViewManager; import com.blazebit.persistence.view.EntityViewSetting; @@ -29,6 +30,7 @@ import com.blazebit.persistence.testsuite.entity.Person; import org.junit.Before; import org.junit.Test; +import org.junit.experimental.categories.Category; import javax.persistence.EntityManager; import java.util.List; @@ -88,7 +90,9 @@ public void setUp() { doc4 = cbf.create(em, Document.class).where("name").eq("doc4").getSingleResult(); } + // NOTE: Hibernate ORM 6.6.1 has a bug: https://hibernate.atlassian.net/browse/HHH-18773 @Test + @Category(NoHibernate66.class) public void testSingletonCollections() { EntityViewManager evm = build( SingletonDocumentCollectionsView.class, diff --git a/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/embedded/entity/EmbeddedMappingEntityTest.java b/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/embedded/entity/EmbeddedMappingEntityTest.java index 8f74306936..d8fc9171dc 100644 --- a/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/embedded/entity/EmbeddedMappingEntityTest.java +++ b/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/embedded/entity/EmbeddedMappingEntityTest.java @@ -17,6 +17,7 @@ package com.blazebit.persistence.view.testsuite.embedded.entity; import com.blazebit.persistence.CriteriaBuilder; +import com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66; import com.blazebit.persistence.view.EntityViewManager; import com.blazebit.persistence.view.EntityViewSetting; import com.blazebit.persistence.view.EntityViews; @@ -28,6 +29,7 @@ import com.blazebit.persistence.testsuite.entity.Document; import org.junit.Before; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.List; @@ -78,7 +80,9 @@ public void multipleEmbeddingsProduceCorrectResults() { assertEquals("doc2", results.get(1).getEmbeddedDetails().getName()); } + // NOTE: Hibernate ORM 6.6.1 has a bug: https://hibernate.atlassian.net/browse/HHH-18773 @Test + @Category(NoHibernate66.class) public void filteringOnEmbeddedAttributeWorks() { CriteriaBuilder criteria = cbf.create(em, Document.class, "e") .orderByAsc("id"); diff --git a/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/updatableonly/EntityViewUpdateUpdatableOnlyEntityCollectionsTest.java b/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/updatableonly/EntityViewUpdateUpdatableOnlyEntityCollectionsTest.java index afc4018edf..ce685f3a00 100644 --- a/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/updatableonly/EntityViewUpdateUpdatableOnlyEntityCollectionsTest.java +++ b/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/updatableonly/EntityViewUpdateUpdatableOnlyEntityCollectionsTest.java @@ -316,7 +316,7 @@ public void testUpdateAddNewEntityToCollection() { AssertStatementBuilder builder = assertUnorderedQuerySequence(); fullFetch(builder); - if (version) { + if (!doesTransientCheckBeforeFlush() && version) { versionUpdate(builder); } builder.validate(); diff --git a/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/updatableonly/EntityViewUpdateUpdatableOnlyEntityMapsTest.java b/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/updatableonly/EntityViewUpdateUpdatableOnlyEntityMapsTest.java index 16b9a7c2f9..8ad3eadb92 100644 --- a/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/updatableonly/EntityViewUpdateUpdatableOnlyEntityMapsTest.java +++ b/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/updatableonly/EntityViewUpdateUpdatableOnlyEntityMapsTest.java @@ -343,7 +343,7 @@ public void testUpdateAddNewEntityToCollection() { } } else { fullFetch(builder); - if (version) { + if (!doesTransientCheckBeforeFlush() && version) { versionUpdate(builder); } } diff --git a/integration/deltaspike-data/testsuite/pom.xml b/integration/deltaspike-data/testsuite/pom.xml index 779f3dab80..c4dedc6e49 100644 --- a/integration/deltaspike-data/testsuite/pom.xml +++ b/integration/deltaspike-data/testsuite/pom.xml @@ -1887,7 +1887,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/integration/hibernate6-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateExtendedQuerySupport.java b/integration/hibernate6-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateExtendedQuerySupport.java index 0f41315657..e13ac8e3f0 100644 --- a/integration/hibernate6-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateExtendedQuerySupport.java +++ b/integration/hibernate6-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateExtendedQuerySupport.java @@ -35,7 +35,6 @@ import org.hibernate.ScrollMode; import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; import org.hibernate.engine.jdbc.spi.JdbcServices; -import org.hibernate.engine.spi.EntityKey; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; @@ -117,7 +116,6 @@ import org.hibernate.sql.exec.spi.JdbcParameterBinder; import org.hibernate.sql.exec.spi.JdbcParameterBindings; import org.hibernate.sql.exec.spi.JdbcParametersList; -import org.hibernate.sql.results.graph.entity.LoadingEntityEntry; import org.hibernate.sql.results.internal.RowTransformerJpaTupleImpl; import org.hibernate.sql.results.internal.RowTransformerSingularReturnImpl; import org.hibernate.sql.results.internal.RowTransformerStandardImpl; @@ -592,10 +590,6 @@ public MappingModelExpressible getResolvedMappingModelType(SqmParameter MappingModelExpressible getResolvedMappingModelType(SqmParameter resolveFunctionReturnType( ReturnableType impliedType, List> arguments, TypeConfiguration typeConfiguration) { - return resolveFunctionReturnType(impliedType, null, arguments, typeConfiguration); + return resolveFunctionReturnType(impliedType, (Supplier>) null, arguments, typeConfiguration); } public ReturnableType resolveFunctionReturnType( diff --git a/integration/hibernate6-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/function/HibernateSqmFunctionDescriptorAdapter.java b/integration/hibernate6-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/function/HibernateSqmFunctionDescriptorAdapter.java index 0cc851d006..e7e78342e1 100644 --- a/integration/hibernate6-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/function/HibernateSqmFunctionDescriptorAdapter.java +++ b/integration/hibernate6-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/function/HibernateSqmFunctionDescriptorAdapter.java @@ -29,6 +29,7 @@ import org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor; import org.hibernate.query.sqm.function.SelfRenderingSqmFunction; import org.hibernate.query.sqm.function.SqmFunctionDescriptor; +import org.hibernate.query.sqm.produce.function.FunctionReturnTypeResolver; import org.hibernate.query.sqm.tree.SqmCopyContext; import org.hibernate.query.sqm.tree.SqmTypedNode; import org.hibernate.query.sqm.tree.SqmVisitableNode; @@ -41,6 +42,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; +import java.util.function.Supplier; /** * @@ -50,6 +52,7 @@ public class HibernateSqmFunctionDescriptorAdapter implements JpqlFunction { private static final Method GENERATE_SQM_EXPRESSION; + private static final Method RESOLVE_FUNCTION_RETURN_TYPE; private static final Constructor QUERY_LITERAL_CONSTRUCTOR; static { @@ -64,6 +67,17 @@ public class HibernateSqmFunctionDescriptorAdapter implements JpqlFunction { } } GENERATE_SQM_EXPRESSION = generateSqmExpression; + Method resolveFunctionReturnType; + try { + resolveFunctionReturnType = FunctionReturnTypeResolver.class.getMethod("resolveFunctionReturnType", ReturnableType.class, Supplier.class, List.class, TypeConfiguration.class); + } catch (NoSuchMethodException e1) { + try { + resolveFunctionReturnType = FunctionReturnTypeResolver.class.getMethod("resolveFunctionReturnType", ReturnableType.class, List.class, TypeConfiguration.class); + } catch (NoSuchMethodException e2) { + throw new RuntimeException("Could not find method to resolve function return type. Please report your version of hibernate so we can provide support for it!", e1); + } + } + RESOLVE_FUNCTION_RETURN_TYPE = resolveFunctionReturnType; Constructor queryLiteralConstructor; try { queryLiteralConstructor = QueryLiteral.class.getConstructor(Object.class, SqlExpressible.class); @@ -130,18 +144,44 @@ public Class getJavaType() { List> arguments = new ArrayList<>(1); arguments.add(new CustomSqmTypedNode<>(type)); if ( function instanceof AbstractSqmFunctionDescriptor ) { - ReturnableType returnableType = ((AbstractSqmFunctionDescriptor) function).getReturnTypeResolver().resolveFunctionReturnType( - null, - arguments, - sfi.getTypeConfiguration() - ); - if (returnableType != null) { - return returnableType.getBindableJavaType(); + try { + FunctionReturnTypeResolver returnTypeResolver = ((AbstractSqmFunctionDescriptor) function).getReturnTypeResolver(); + ReturnableType returnableType; + if (RESOLVE_FUNCTION_RETURN_TYPE.getParameterCount() == 4) { + returnableType = (ReturnableType) RESOLVE_FUNCTION_RETURN_TYPE.invoke( + returnTypeResolver, + null, + null, + arguments, + sfi.getTypeConfiguration() + ); + } else { + returnableType = (ReturnableType) RESOLVE_FUNCTION_RETURN_TYPE.invoke( + returnTypeResolver, + null, + arguments, + sfi.getTypeConfiguration() + ); + } + if (returnableType != null) { + return returnableType.getBindableJavaType(); + } + } catch (IllegalAccessException e) { + throw new RuntimeException("Could not resolve function return type. Please report your version of hibernate so we can provide support for it!", e); + } catch (InvocationTargetException e) { + if (e.getTargetException() instanceof RuntimeException) { + throw (RuntimeException) e.getTargetException(); + } + throw new RuntimeException("Could not resolve function return type", e); } } try { - SqmExpressible expressionType = ((SelfRenderingSqmFunction) GENERATE_SQM_EXPRESSION.invoke(function, arguments, null, sfi.getQueryEngine(), sfi.getTypeConfiguration())) - .getNodeType(); + SqmExpressible expressionType; + if (GENERATE_SQM_EXPRESSION.getParameterCount() == 4) { + expressionType = ((SelfRenderingSqmFunction) GENERATE_SQM_EXPRESSION.invoke(function, arguments, null, sfi.getQueryEngine(), sfi.getTypeConfiguration())).getNodeType(); + } else { + expressionType = ((SelfRenderingSqmFunction) GENERATE_SQM_EXPRESSION.invoke(function, arguments, null, sfi.getQueryEngine())).getNodeType(); + } return expressionType == null ? null : expressionType.getBindableJavaType(); } catch (IllegalAccessException e) { throw new RuntimeException("Could not generate SQM expression for function. Please report your version of hibernate so we can provide support for it!", e); diff --git a/integration/quarkus-3/deployment/pom.xml b/integration/quarkus-3/deployment/pom.xml index 20e2fab90b..2bbfc7f1d0 100644 --- a/integration/quarkus-3/deployment/pom.xml +++ b/integration/quarkus-3/deployment/pom.xml @@ -629,7 +629,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernatecom.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/integration/querydsl/testsuite/pom.xml b/integration/querydsl/testsuite/pom.xml index ae139aab5b..833ff3d4be 100644 --- a/integration/querydsl/testsuite/pom.xml +++ b/integration/querydsl/testsuite/pom.xml @@ -1774,7 +1774,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/integration/spring-data/testsuite/webflux/pom.xml b/integration/spring-data/testsuite/webflux/pom.xml index 89c8d094a0..61586fa21d 100644 --- a/integration/spring-data/testsuite/webflux/pom.xml +++ b/integration/spring-data/testsuite/webflux/pom.xml @@ -1912,7 +1912,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 hibernate diff --git a/integration/spring-data/testsuite/webmvc/pom.xml b/integration/spring-data/testsuite/webmvc/pom.xml index 0888494baa..44ee57c441 100644 --- a/integration/spring-data/testsuite/webmvc/pom.xml +++ b/integration/spring-data/testsuite/webmvc/pom.xml @@ -1962,7 +1962,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 hibernate diff --git a/jpa-criteria/testsuite-jakarta-runner/pom.xml b/jpa-criteria/testsuite-jakarta-runner/pom.xml index 2d4677ad13..a67ccbbd3e 100644 --- a/jpa-criteria/testsuite-jakarta-runner/pom.xml +++ b/jpa-criteria/testsuite-jakarta-runner/pom.xml @@ -370,7 +370,7 @@ hibernate-6.6 ${version.jakarta-jpa-3.1-api} - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/jpa-criteria/testsuite/pom.xml b/jpa-criteria/testsuite/pom.xml index 8e92a8e0a5..151abe9866 100644 --- a/jpa-criteria/testsuite/pom.xml +++ b/jpa-criteria/testsuite/pom.xml @@ -1539,7 +1539,7 @@ hibernate-6.6 - com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60 + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 diff --git a/parent/pom.xml b/parent/pom.xml index 6dc0d0555c..51521b3b49 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -78,7 +78,7 @@ 6.3.1.Final 6.4.2.Final 6.5.2.Final - 6.6.0.Alpha1 + 6.6.1.Final 4.1.17 4.1.19 diff --git a/testsuite-base/hibernate/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java b/testsuite-base/hibernate/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java index 64c450c678..4f6962941f 100644 --- a/testsuite-base/hibernate/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java +++ b/testsuite-base/hibernate/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java @@ -221,6 +221,7 @@ public boolean supportsTableGroupJoins() { return major > 5 || (major == 5 && (minor > 2 || (minor == 2 && fix >= 8))); } + @Override protected boolean doesJpaMergeOfRecentlyPersistedEntityForceUpdate() { // Not sure when exactly this got fixed, but 5.1 doesn't seem to have that problem String version = org.hibernate.Version.getVersionString(); @@ -231,6 +232,7 @@ protected boolean doesJpaMergeOfRecentlyPersistedEntityForceUpdate() { return major < 5 || major == 5 && minor < 1 || major == 5 && minor == 1 && fix < 0; } + @Override protected boolean supportsIndexedInplaceUpdate() { // Hibernate 4 doesn't support inplace updates return isHibernate5(); diff --git a/testsuite-base/hibernate6/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java b/testsuite-base/hibernate6/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java index 03b41a46fe..949a5d44cf 100644 --- a/testsuite-base/hibernate6/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java +++ b/testsuite-base/hibernate6/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java @@ -177,6 +177,11 @@ protected boolean doesJpaMergeOfRecentlyPersistedEntityForceUpdate() { return false; } + @Override + protected boolean doesTransientCheckBeforeFlush() { + return HIBERNATE_MAJOR_VERSION > 6 || HIBERNATE_MINOR_VERSION > 5; + } + protected boolean supportsIndexedInplaceUpdate() { return true; } diff --git a/testsuite-base/jpa/src/main/java/com/blazebit/persistence/testsuite/base/jpa/AbstractJpaPersistenceTest.java b/testsuite-base/jpa/src/main/java/com/blazebit/persistence/testsuite/base/jpa/AbstractJpaPersistenceTest.java index 71b5433f68..3251baeb3b 100644 --- a/testsuite-base/jpa/src/main/java/com/blazebit/persistence/testsuite/base/jpa/AbstractJpaPersistenceTest.java +++ b/testsuite-base/jpa/src/main/java/com/blazebit/persistence/testsuite/base/jpa/AbstractJpaPersistenceTest.java @@ -559,6 +559,10 @@ protected boolean doesJpaMergeOfRecentlyPersistedEntityForceUpdate() { return true; } + protected boolean doesTransientCheckBeforeFlush() { + return false; + } + @After public void destruct() { // NOTE: We need to close the entity manager or else we could run into a deadlock on some dbms platforms diff --git a/testsuite-base/jpa/src/main/java/com/blazebit/persistence/testsuite/base/jpa/category/NoHibernate66.java b/testsuite-base/jpa/src/main/java/com/blazebit/persistence/testsuite/base/jpa/category/NoHibernate66.java new file mode 100644 index 0000000000..deb16fdf21 --- /dev/null +++ b/testsuite-base/jpa/src/main/java/com/blazebit/persistence/testsuite/base/jpa/category/NoHibernate66.java @@ -0,0 +1,21 @@ +/* + * Copyright 2014 - 2024 Blazebit. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.blazebit.persistence.testsuite.base.jpa.category; + +public interface NoHibernate66 { + +}