diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 15f52fa681..86ab453a72 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -610,6 +610,13 @@ jobs: jdk: 17 spring-data: spring-data-4.0.x ################################################ +# hibernate-7.3 +################################################ + - rdbms: h2 + provider: hibernate-7.3 + jdk: 17 + spring-data: spring-data-4.0.x +################################################ # LTS JDKs ################################################ - rdbms: h2 diff --git a/ci/build-github-latest.sh b/ci/build-github-latest.sh index 1e6cbcf51a..92e7a57092 100755 --- a/ci/build-github-latest.sh +++ b/ci/build-github-latest.sh @@ -28,6 +28,10 @@ elif [ "$COMPONENT" == 'hibernate-7.2' ]; then export JPAPROVIDER="hibernate-7.2" export SPRING_DATA="spring-data-4.0.x" export PROPERTIES="-s $DIR/latest-settings.xml -Dversion.hibernate-7.2=[7.2,7.2.Alpha)" +elif [ "$COMPONENT" == 'hibernate-7.3' ]; then + export JPAPROVIDER="hibernate-7.3" + export SPRING_DATA="spring-data-4.0.x" + export PROPERTIES="-s $DIR/latest-settings.xml -Dversion.hibernate-7.3=[7.3,7.3.Alpha)" else export JPAPROVIDER="hibernate-6.2" export SPRING_DATA="spring-data-3.1.x" diff --git a/core/testsuite-hibernate6/pom.xml b/core/testsuite-hibernate6/pom.xml index 92f86000a8..332fb303dd 100644 --- a/core/testsuite-hibernate6/pom.xml +++ b/core/testsuite-hibernate6/pom.xml @@ -962,5 +962,66 @@ + + hibernate-7.3 + + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate70,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate72 + + + + org.hibernate + hibernate-core + ${version.hibernate-7.3} + + + org.hibernate + hibernate-envers + ${version.hibernate-7.3} + + + org.hibernate + hibernate-testing + ${version.hibernate-7.3} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jakarta-jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jakarta-jaxb} + + + jakarta.persistence + jakarta.persistence-api + ${version.jakarta-jpa-3.2-api} + provided + + + jakarta.transaction + jakarta.transaction-api + ${version.jakarta-jta} + + + jakarta.activation + jakarta.activation-api + ${version.jakarta-activation} + + + ${project.groupId} + blaze-persistence-integration-hibernate-7.2 + test + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-7.3} + provided + + + diff --git a/core/testsuite-jakarta-runner/pom.xml b/core/testsuite-jakarta-runner/pom.xml index 52fd5c904d..38d0cefa32 100644 --- a/core/testsuite-jakarta-runner/pom.xml +++ b/core/testsuite-jakarta-runner/pom.xml @@ -901,6 +901,68 @@ + + hibernate-7.3 + + ${version.jakarta-jpa-3.2-api} + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate70,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate72 + + + + org.hibernate.orm + hibernate-core + ${version.hibernate-7.3} + + + org.hibernate.orm + hibernate-envers + ${version.hibernate-7.3} + + + org.hibernate.orm + hibernate-testing + ${version.hibernate-7.3} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jakarta-jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jakarta-jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jakarta-jta} + + + jakarta.activation + jakarta.activation-api + ${version.jakarta-activation} + + + ${project.groupId} + blaze-persistence-integration-hibernate-7.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate7 + ${project.version} + compile + + + + org.hibernate.orm + hibernate-jpamodelgen + ${version.hibernate-7.3} + provided + + + diff --git a/core/testsuite/pom.xml b/core/testsuite/pom.xml index e606637b3b..5090c82583 100644 --- a/core/testsuite/pom.xml +++ b/core/testsuite/pom.xml @@ -3089,6 +3089,175 @@ + + hibernate-7.3 + + + 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 + + + + org.hibernate + hibernate-core + ${version.hibernate-5.6} + + + org.hibernate + hibernate-envers + ${version.hibernate-5.6} + + + org.hibernate + hibernate-testing + ${version.hibernate-5.6} + + + com.vladmihalcea + hibernate-types-52 + ${version.hibernate-types} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jakarta-jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jakarta-jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jakarta-jta} + + + jakarta.activation + jakarta.activation-api + ${version.jakarta-activation} + + + ${project.groupId} + blaze-persistence-integration-hibernate-6.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate + compile + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + provided + + + + + + maven-surefire-plugin + + true + + + + maven-jar-plugin + + + + test-jar + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${additional.source.directory} + ${project.build.directory}/generated-sources/metamodel + + + + + add-test-source-hibernate + generate-test-sources + + add-test-source + + + + src/test/hibernate + + + + + + + org.bsc.maven + maven-processor-plugin + + + process + + process + + generate-sources + + + ${additional.source.directory} + + + ${project.build.directory}/generated-sources/metamodel + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + + + + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jakarta-jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jakarta-jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jakarta-jta} + + + jakarta.activation + jakarta.activation-api + ${version.jakarta-activation} + + + + + + eclipselink diff --git a/entity-view/testsuite-jakarta-runner/pom.xml b/entity-view/testsuite-jakarta-runner/pom.xml index 655e71eeda..b154e5276b 100644 --- a/entity-view/testsuite-jakarta-runner/pom.xml +++ b/entity-view/testsuite-jakarta-runner/pom.xml @@ -913,6 +913,68 @@ + + hibernate-7.3 + + ${version.jakarta-jpa-3.2-api} + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate70,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate72 + + + + org.hibernate.orm + hibernate-core + ${version.hibernate-7.3} + + + org.hibernate.orm + hibernate-envers + ${version.hibernate-7.3} + + + org.hibernate.orm + hibernate-testing + ${version.hibernate-7.3} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jakarta-jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jakarta-jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jakarta-jta} + + + jakarta.activation + jakarta.activation-api + ${version.jakarta-activation} + + + ${project.groupId} + blaze-persistence-integration-hibernate-7.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate7 + ${project.version} + compile + + + + org.hibernate.orm + hibernate-jpamodelgen + ${version.hibernate-7.3} + provided + + + diff --git a/entity-view/testsuite/pom.xml b/entity-view/testsuite/pom.xml index 53f3c60f70..ac99176a30 100644 --- a/entity-view/testsuite/pom.xml +++ b/entity-view/testsuite/pom.xml @@ -2248,6 +2248,123 @@ + + hibernate-7.3 + + + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 + + + + org.hibernate + hibernate-core + ${version.hibernate-5.6} + + + ${project.groupId} + blaze-persistence-integration-hibernate-6.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate + test + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + provided + + + + + + maven-surefire-plugin + + true + + + + maven-jar-plugin + + + + test-jar + + + + + + org.bsc.maven + maven-processor-plugin + + + process-test + + process-test + + generate-test-sources + + + ${project.build.directory}/test-metamodel + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + + + + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jta} + + + jakarta.activation + jakarta.activation-api + ${version.activation} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-test-source-metamodel + generate-test-sources + + add-test-source + + + + ${project.build.directory}/test-metamodel + + + + + + + + eclipselink diff --git a/examples/quarkus-3/base/pom.xml b/examples/quarkus-3/base/pom.xml index 2772c3c261..9ef49cc550 100644 --- a/examples/quarkus-3/base/pom.xml +++ b/examples/quarkus-3/base/pom.xml @@ -78,7 +78,13 @@ hibernate-7.2 - 7.1 + 7.2 + + + + hibernate-7.3 + + 7.2 diff --git a/examples/quarkus-3/pom.xml b/examples/quarkus-3/pom.xml index 98a2e8618c..b2eec1da08 100644 --- a/examples/quarkus-3/pom.xml +++ b/examples/quarkus-3/pom.xml @@ -87,5 +87,13 @@ ${version.quarkus-3.32} + + hibernate-7.3 + + ${version.jakarta-jpa-3.2-api} + ${version.hibernate-7.2} + ${version.quarkus-3.32} + + diff --git a/examples/quarkus-3/testsuite/base/pom.xml b/examples/quarkus-3/testsuite/base/pom.xml index caaccbb6f0..0cc826be19 100644 --- a/examples/quarkus-3/testsuite/base/pom.xml +++ b/examples/quarkus-3/testsuite/base/pom.xml @@ -107,6 +107,12 @@ 7.2 + + hibernate-7.3 + + 7.2 + + postgresql diff --git a/examples/quarkus-3/testsuite/native/db2/pom.xml b/examples/quarkus-3/testsuite/native/db2/pom.xml index e9fae2f08a..734873f4db 100644 --- a/examples/quarkus-3/testsuite/native/db2/pom.xml +++ b/examples/quarkus-3/testsuite/native/db2/pom.xml @@ -67,6 +67,12 @@ 7.2 + + hibernate-7.3 + + 7.2 + + diff --git a/examples/quarkus-3/testsuite/native/h2/pom.xml b/examples/quarkus-3/testsuite/native/h2/pom.xml index cd3ff49fec..b92684afa4 100644 --- a/examples/quarkus-3/testsuite/native/h2/pom.xml +++ b/examples/quarkus-3/testsuite/native/h2/pom.xml @@ -72,6 +72,12 @@ 7.2 + + hibernate-7.3 + + 7.2 + + diff --git a/examples/quarkus-3/testsuite/native/mssql/pom.xml b/examples/quarkus-3/testsuite/native/mssql/pom.xml index a41065a8bd..1285077a26 100644 --- a/examples/quarkus-3/testsuite/native/mssql/pom.xml +++ b/examples/quarkus-3/testsuite/native/mssql/pom.xml @@ -67,6 +67,12 @@ 7.2 + + hibernate-7.3 + + 7.2 + + diff --git a/examples/quarkus-3/testsuite/native/mysql/pom.xml b/examples/quarkus-3/testsuite/native/mysql/pom.xml index c94efea1f5..8146ea5125 100644 --- a/examples/quarkus-3/testsuite/native/mysql/pom.xml +++ b/examples/quarkus-3/testsuite/native/mysql/pom.xml @@ -67,6 +67,12 @@ 7.2 + + hibernate-7.3 + + 7.2 + + diff --git a/examples/quarkus-3/testsuite/native/postgresql/pom.xml b/examples/quarkus-3/testsuite/native/postgresql/pom.xml index 0d6d0203f1..4f043d890f 100644 --- a/examples/quarkus-3/testsuite/native/postgresql/pom.xml +++ b/examples/quarkus-3/testsuite/native/postgresql/pom.xml @@ -67,6 +67,12 @@ 7.2 + + hibernate-7.3 + + 7.2 + + diff --git a/integration/deltaspike-data/testsuite/pom.xml b/integration/deltaspike-data/testsuite/pom.xml index d7125b87a1..9887df3d8c 100644 --- a/integration/deltaspike-data/testsuite/pom.xml +++ b/integration/deltaspike-data/testsuite/pom.xml @@ -2234,6 +2234,123 @@ + + hibernate-7.3 + + + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 + + + + org.hibernate + hibernate-core + ${version.hibernate-5.6} + + + ${project.groupId} + blaze-persistence-integration-hibernate-6.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate + compile + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + provided + + + + + + maven-surefire-plugin + + true + + + + maven-jar-plugin + + + + test-jar + + + + + + org.bsc.maven + maven-processor-plugin + + + process + + process + + generate-sources + + + ${project.build.directory}/generated-sources/metamodel + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + + + + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jta} + + + jakarta.activation + jakarta.activation-api + ${version.activation} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/metamodel + + + + + + + + eclipselink diff --git a/integration/hibernate-6.2/pom.xml b/integration/hibernate-6.2/pom.xml index 6cb244e65a..7d637b3f06 100644 --- a/integration/hibernate-6.2/pom.xml +++ b/integration/hibernate-6.2/pom.xml @@ -208,5 +208,11 @@ ${version.hibernate-6.6} + + hibernate-7.3 + + ${version.hibernate-6.6} + + diff --git a/integration/hibernate-7.1/pom.xml b/integration/hibernate-7.1/pom.xml index f705c9b905..a08d9f27db 100644 --- a/integration/hibernate-7.1/pom.xml +++ b/integration/hibernate-7.1/pom.xml @@ -208,5 +208,11 @@ ${version.hibernate-7.1} + + hibernate-7.3 + + ${version.hibernate-7.1} + + diff --git a/integration/hibernate-7.1/src/main/java/com/blazebit/persistence/integration/hibernate/Hibernate7Access.java b/integration/hibernate-7.1/src/main/java/com/blazebit/persistence/integration/hibernate/Hibernate7Access.java index c137d64b43..642195311b 100644 --- a/integration/hibernate-7.1/src/main/java/com/blazebit/persistence/integration/hibernate/Hibernate7Access.java +++ b/integration/hibernate-7.1/src/main/java/com/blazebit/persistence/integration/hibernate/Hibernate7Access.java @@ -11,18 +11,23 @@ import com.blazebit.persistence.spi.DbmsDialect; import org.hibernate.ScrollMode; +import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; import org.hibernate.engine.jdbc.spi.JdbcCoordinator; +import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.event.spi.EventSource; import org.hibernate.query.spi.DomainQueryExecutionContext; +import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.spi.ScrollableResultsImplementor; import org.hibernate.query.sqm.internal.SqmJdbcExecutionContextAdapter; +import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.SqlSelection; import org.hibernate.sql.ast.tree.expression.JdbcParameter; +import org.hibernate.sql.ast.tree.select.SelectStatement; import org.hibernate.sql.exec.spi.ExecutionContext; -import org.hibernate.sql.exec.spi.JdbcOperationQuery; +import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.sql.exec.spi.JdbcOperationQueryDelete; import org.hibernate.sql.exec.spi.JdbcOperationQueryMutation; import org.hibernate.sql.exec.spi.JdbcOperationQuerySelect; @@ -81,10 +86,10 @@ public JdbcOperationQueryMutation createJdbcUpdate( } @Override - public JdbcOperationQuery createJdbcSelect( + public JdbcOperation createJdbcSelect( String sql, List parameterBinders, - JdbcOperationQuery original, + JdbcOperation original, Set affectedTableNames) { JdbcOperationQuerySelect jdbcSelect = (JdbcOperationQuerySelect) original; return new JdbcOperationQuerySelect( @@ -102,10 +107,10 @@ public JdbcOperationQuery createJdbcSelect( } @Override - public JdbcOperationQuery createFullJdbcSelect( + public JdbcOperation createFullJdbcSelect( String sql, List parameterBinders, - JdbcOperationQuery original, + JdbcOperation original, Set affectedTableNames) { JdbcOperationQuerySelect jdbcSelect = (JdbcOperationQuerySelect) original; return new JdbcOperationQuerySelect( @@ -123,23 +128,36 @@ public JdbcOperationQuery createFullJdbcSelect( } @Override - public JdbcParameter getLimitParameter(JdbcOperationQuery query) { + public JdbcOperation translateJdbcSelect( + SessionFactoryImplementor sessionFactory, + SelectStatement selectStatement, + JdbcParameterBindings jdbcParameterBindings, + QueryOptions queryOptions) { + final JdbcServices jdbcServices = sessionFactory.getJdbcServices(); + final JdbcEnvironment jdbcEnvironment = jdbcServices.getJdbcEnvironment(); + final SqlAstTranslatorFactory sqlAstTranslatorFactory = jdbcEnvironment.getSqlAstTranslatorFactory(); + return sqlAstTranslatorFactory.buildSelectTranslator(sessionFactory, selectStatement) + .translate(jdbcParameterBindings, queryOptions); + } + + @Override + public JdbcParameter getLimitParameter(JdbcOperation query) { return ((JdbcOperationQuerySelect) query).getLimitParameter(); } @Override - public JdbcParameter getOffsetParameter(JdbcOperationQuery query) { + public JdbcParameter getOffsetParameter(JdbcOperation query) { return ((JdbcOperationQuerySelect) query).getOffsetParameter(); } @Override - public ExecutionContext createExecutionContextAdapter(DomainQueryExecutionContext executionContext, JdbcOperationQuery query) { + public ExecutionContext createExecutionContextAdapter(DomainQueryExecutionContext executionContext, JdbcOperation query) { return new SqmJdbcExecutionContextAdapter(executionContext, (JdbcOperationQuerySelect) query); } @Override public List list( - JdbcOperationQuery jdbcSelect, + JdbcOperation jdbcSelect, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, RowTransformer rowTransformer, @@ -155,7 +173,7 @@ public List list( @Override public ScrollableResultsImplementor scroll( - JdbcOperationQuery jdbcSelect, + JdbcOperation jdbcSelect, ScrollMode scrollMode, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, @@ -170,7 +188,7 @@ public ScrollableResultsImplementor scroll( } @Override - public int[] getReturningColumnTypes(JdbcOperationQuery queryPlan, SessionFactoryImplementor sfi) { + public int[] getReturningColumnTypes(JdbcOperation queryPlan, SessionFactoryImplementor sfi) { JdbcValuesMapping jdbcValuesMapping = ((JdbcOperationQuerySelect) queryPlan).getJdbcValuesMappingProducer().resolve( null, null, sfi); List sqlSelections = jdbcValuesMapping.getSqlSelections(); List sqlTypes = new ArrayList<>(sqlSelections.size()); diff --git a/integration/hibernate-7.2/pom.xml b/integration/hibernate-7.2/pom.xml index e1e6d51e60..8a499031b8 100644 --- a/integration/hibernate-7.2/pom.xml +++ b/integration/hibernate-7.2/pom.xml @@ -208,5 +208,11 @@ ${version.hibernate-7.2} + + hibernate-7.3 + + ${version.hibernate-7.3} + + diff --git a/integration/hibernate-7.2/src/main/java/com/blazebit/persistence/integration/hibernate/Hibernate7Access.java b/integration/hibernate-7.2/src/main/java/com/blazebit/persistence/integration/hibernate/Hibernate7Access.java index 76cf834dbc..639f5aa5a9 100644 --- a/integration/hibernate-7.2/src/main/java/com/blazebit/persistence/integration/hibernate/Hibernate7Access.java +++ b/integration/hibernate-7.2/src/main/java/com/blazebit/persistence/integration/hibernate/Hibernate7Access.java @@ -11,21 +11,26 @@ import com.blazebit.persistence.spi.DbmsDialect; import org.hibernate.ScrollMode; +import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; import org.hibernate.engine.jdbc.spi.JdbcCoordinator; +import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.event.spi.EventSource; import org.hibernate.query.spi.DomainQueryExecutionContext; +import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.spi.ScrollableResultsImplementor; import org.hibernate.query.sqm.internal.SqmJdbcExecutionContextAdapter; +import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.SqlSelection; import org.hibernate.sql.ast.tree.expression.JdbcParameter; +import org.hibernate.sql.ast.tree.select.SelectStatement; import org.hibernate.sql.exec.internal.JdbcOperationQueryDelete; import org.hibernate.sql.exec.internal.JdbcOperationQuerySelect; import org.hibernate.sql.exec.internal.JdbcOperationQueryUpdate; import org.hibernate.sql.exec.spi.ExecutionContext; -import org.hibernate.sql.exec.spi.JdbcOperationQuery; +import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.sql.exec.spi.JdbcOperationQueryMutation; import org.hibernate.sql.exec.spi.JdbcParameterBinder; import org.hibernate.sql.exec.spi.JdbcParameterBindings; @@ -82,10 +87,10 @@ public JdbcOperationQueryMutation createJdbcUpdate( } @Override - public JdbcOperationQuery createJdbcSelect( + public JdbcOperation createJdbcSelect( String sql, List parameterBinders, - JdbcOperationQuery original, + JdbcOperation original, Set affectedTableNames) { JdbcOperationQuerySelect jdbcSelect = (JdbcOperationQuerySelect) original; return new JdbcOperationQuerySelect( @@ -103,10 +108,10 @@ public JdbcOperationQuery createJdbcSelect( } @Override - public JdbcOperationQuery createFullJdbcSelect( + public JdbcOperation createFullJdbcSelect( String sql, List parameterBinders, - JdbcOperationQuery original, + JdbcOperation original, Set affectedTableNames) { JdbcOperationQuerySelect jdbcSelect = (JdbcOperationQuerySelect) original; return new JdbcOperationQuerySelect( @@ -124,23 +129,36 @@ public JdbcOperationQuery createFullJdbcSelect( } @Override - public JdbcParameter getLimitParameter(JdbcOperationQuery query) { + public JdbcOperation translateJdbcSelect( + SessionFactoryImplementor sessionFactory, + SelectStatement selectStatement, + JdbcParameterBindings jdbcParameterBindings, + QueryOptions queryOptions) { + final JdbcServices jdbcServices = sessionFactory.getJdbcServices(); + final JdbcEnvironment jdbcEnvironment = jdbcServices.getJdbcEnvironment(); + final SqlAstTranslatorFactory sqlAstTranslatorFactory = jdbcEnvironment.getSqlAstTranslatorFactory(); + return sqlAstTranslatorFactory.buildSelectTranslator(sessionFactory, selectStatement) + .translate(jdbcParameterBindings, queryOptions); + } + + @Override + public JdbcParameter getLimitParameter(JdbcOperation query) { return ((JdbcOperationQuerySelect) query).getLimitParameter(); } @Override - public JdbcParameter getOffsetParameter(JdbcOperationQuery query) { + public JdbcParameter getOffsetParameter(JdbcOperation query) { return ((JdbcOperationQuerySelect) query).getOffsetParameter(); } @Override - public ExecutionContext createExecutionContextAdapter(DomainQueryExecutionContext executionContext, JdbcOperationQuery query) { + public ExecutionContext createExecutionContextAdapter(DomainQueryExecutionContext executionContext, JdbcOperation query) { return new SqmJdbcExecutionContextAdapter(executionContext, (JdbcSelect) query); } @Override public List list( - JdbcOperationQuery jdbcSelect, + JdbcOperation jdbcSelect, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, RowTransformer rowTransformer, @@ -156,7 +174,7 @@ public List list( @Override public ScrollableResultsImplementor scroll( - JdbcOperationQuery jdbcSelect, + JdbcOperation jdbcSelect, ScrollMode scrollMode, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, @@ -171,7 +189,7 @@ public ScrollableResultsImplementor scroll( } @Override - public int[] getReturningColumnTypes(JdbcOperationQuery queryPlan, SessionFactoryImplementor sfi) { + public int[] getReturningColumnTypes(JdbcOperation queryPlan, SessionFactoryImplementor sfi) { JdbcValuesMapping jdbcValuesMapping = ((JdbcSelect) queryPlan).getJdbcValuesMappingProducer().resolve( null, null, sfi); List sqlSelections = jdbcValuesMapping.getSqlSelections(); List sqlTypes = new ArrayList<>(sqlSelections.size()); diff --git a/integration/hibernate6-base/pom.xml b/integration/hibernate6-base/pom.xml index 99218723ba..d6c2ed3d80 100644 --- a/integration/hibernate6-base/pom.xml +++ b/integration/hibernate6-base/pom.xml @@ -188,5 +188,11 @@ ${version.hibernate-6.6} + + hibernate-7.3 + + ${version.hibernate-6.6} + + diff --git a/integration/hibernate7-base/pom.xml b/integration/hibernate7-base/pom.xml index 4664d11704..69c45ee383 100644 --- a/integration/hibernate7-base/pom.xml +++ b/integration/hibernate7-base/pom.xml @@ -189,5 +189,11 @@ ${version.hibernate-7.2} + + hibernate-7.3 + + ${version.hibernate-7.3} + + diff --git a/integration/hibernate7-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateAccess.java b/integration/hibernate7-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateAccess.java index 6f184426f4..7edcfb2342 100644 --- a/integration/hibernate7-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateAccess.java +++ b/integration/hibernate7-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateAccess.java @@ -13,10 +13,12 @@ import org.hibernate.ScrollMode; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.query.spi.DomainQueryExecutionContext; +import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.spi.ScrollableResultsImplementor; import org.hibernate.sql.ast.tree.expression.JdbcParameter; +import org.hibernate.sql.ast.tree.select.SelectStatement; import org.hibernate.sql.exec.spi.ExecutionContext; -import org.hibernate.sql.exec.spi.JdbcOperationQuery; +import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.sql.exec.spi.JdbcOperationQueryMutation; import org.hibernate.sql.exec.spi.JdbcParameterBinder; import org.hibernate.sql.exec.spi.JdbcParameterBindings; @@ -32,12 +34,13 @@ public interface HibernateAccess { public ExecutionContext wrapExecutionContext(ExecutionContext executionContext, DbmsDialect dbmsDialect, String[][] returningColumns, int[] returningColumnTypes, HibernateReturningResult returningResult); public JdbcOperationQueryMutation createJdbcDelete(JdbcOperationQueryMutation delete, StringBuilder newSb); public JdbcOperationQueryMutation createJdbcUpdate(String sql, List parameterBinders, Set affectedTableNames); - public JdbcOperationQuery createJdbcSelect(String sql, List parameterBinders, JdbcOperationQuery original, Set affectedTableNames); - public JdbcOperationQuery createFullJdbcSelect(String sql, List parameterBinders, JdbcOperationQuery original, Set affectedTableNames); - public JdbcParameter getLimitParameter(JdbcOperationQuery query); - public JdbcParameter getOffsetParameter(JdbcOperationQuery query); - public ExecutionContext createExecutionContextAdapter(DomainQueryExecutionContext executionContext, JdbcOperationQuery query); - public int[] getReturningColumnTypes(JdbcOperationQuery queryPlan, SessionFactoryImplementor sfi); - public List list(JdbcOperationQuery jdbcSelect, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, RowTransformer rowTransformer, ListResultsConsumer.UniqueSemantic uniqueSemantic); - public ScrollableResultsImplementor scroll(JdbcOperationQuery jdbcSelect, ScrollMode scrollMode, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, RowTransformer rowTransformer); + public JdbcOperation createJdbcSelect(String sql, List parameterBinders, JdbcOperation original, Set affectedTableNames); + public JdbcOperation createFullJdbcSelect(String sql, List parameterBinders, JdbcOperation original, Set affectedTableNames); + public JdbcOperation translateJdbcSelect(SessionFactoryImplementor sessionFactory, SelectStatement selectStatement, JdbcParameterBindings jdbcParameterBindings, QueryOptions queryOptions); + public JdbcParameter getLimitParameter(JdbcOperation query); + public JdbcParameter getOffsetParameter(JdbcOperation query); + public ExecutionContext createExecutionContextAdapter(DomainQueryExecutionContext executionContext, JdbcOperation query); + public int[] getReturningColumnTypes(JdbcOperation queryPlan, SessionFactoryImplementor sfi); + public List list(JdbcOperation jdbcSelect, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, RowTransformer rowTransformer, ListResultsConsumer.UniqueSemantic uniqueSemantic); + public ScrollableResultsImplementor scroll(JdbcOperation jdbcSelect, ScrollMode scrollMode, JdbcParameterBindings jdbcParameterBindings, ExecutionContext executionContext, RowTransformer rowTransformer); } diff --git a/integration/hibernate7-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateExtendedQuerySupport.java b/integration/hibernate7-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateExtendedQuerySupport.java index a1238927f8..c9ea7df9ad 100644 --- a/integration/hibernate7-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateExtendedQuerySupport.java +++ b/integration/hibernate7-base/src/main/java/com/blazebit/persistence/integration/hibernate/base/HibernateExtendedQuerySupport.java @@ -107,7 +107,7 @@ import org.hibernate.sql.ast.tree.update.UpdateStatement; import org.hibernate.sql.exec.internal.JdbcParameterBindingsImpl; import org.hibernate.sql.exec.spi.ExecutionContext; -import org.hibernate.sql.exec.spi.JdbcOperationQuery; +import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.sql.exec.spi.JdbcOperationQueryMutation; import org.hibernate.sql.exec.spi.JdbcParameterBinder; import org.hibernate.sql.exec.spi.JdbcParameterBindings; @@ -644,7 +644,7 @@ private List getResultList(com.blazebit.persistence.spi.ServiceProvider serviceP for (Query participatingQuery : participatingQueries) { CacheableSqmInterpretation interpretation = buildQueryPlan(participatingQuery); JdbcTranslation translation = getJdbcTranslation(sessionFactory, interpretation, participatingQuery.unwrap(SqmQueryImpl.class)); - JdbcOperationQuery jdbcOperation = translation.query; + JdbcOperation jdbcOperation = translation.query; if (query == participatingQuery) { // Don't copy over the limit and offset parameters because we need to use the LimitHandler for now for (JdbcParameterBinder parameterBinder : jdbcOperation.getParameterBinders()) { @@ -664,9 +664,8 @@ private List getResultList(com.blazebit.persistence.spi.ServiceProvider serviceP // todo: avoid double translation CacheableSqmInterpretation interpretation = buildQueryPlan(query); - final JdbcOperationQuery jdbcSelect = sqlAstTranslatorFactory.buildSelectTranslator(sessionFactory, (SelectStatement) interpretation.getSqmTranslation().getSqlAst()) - .translate(jdbcParameterBindings, executionContext.getQueryOptions()); - final JdbcOperationQuery realJdbcSelect = hibernateAccess.createJdbcSelect( + final JdbcOperation jdbcSelect = hibernateAccess.translateJdbcSelect( sessionFactory, (SelectStatement) interpretation.getSqmTranslation().getSqlAst(), jdbcParameterBindings, executionContext.getQueryOptions()); + final JdbcOperation realJdbcSelect = hibernateAccess.createJdbcSelect( sqlOverride, parameterBinders, jdbcSelect, @@ -731,7 +730,7 @@ private Object getResultStream(com.blazebit.persistence.spi.ServiceProvider serv for (Query participatingQuery : participatingQueries) { CacheableSqmInterpretation interpretation = buildQueryPlan(participatingQuery); JdbcTranslation translation = getJdbcTranslation(sessionFactory, interpretation, participatingQuery.unwrap(SqmQueryImpl.class)); - JdbcOperationQuery jdbcOperation = translation.query; + JdbcOperation jdbcOperation = translation.query; parameterBinders.addAll(jdbcOperation.getParameterBinders()); affectedTableNames.addAll(jdbcOperation.getAffectedTableNames()); final JdbcParameterBindings tempJdbcParameterBindings = translation.parameterBindings; @@ -741,9 +740,8 @@ private Object getResultStream(com.blazebit.persistence.spi.ServiceProvider serv } CacheableSqmInterpretation interpretation = buildQueryPlan(query); - final JdbcOperationQuery jdbcSelect = sqlAstTranslatorFactory.buildSelectTranslator(sessionFactory, (SelectStatement) interpretation.getSqmTranslation().getSqlAst()) - .translate(jdbcParameterBindings, executionContext.getQueryOptions()); - final JdbcOperationQuery realJdbcSelect = hibernateAccess.createJdbcSelect( + final JdbcOperation jdbcSelect = hibernateAccess.translateJdbcSelect( sessionFactory, (SelectStatement) interpretation.getSqmTranslation().getSqlAst(), jdbcParameterBindings, executionContext.getQueryOptions()); + final JdbcOperation realJdbcSelect = hibernateAccess.createJdbcSelect( sqlOverride, parameterBinders, jdbcSelect, @@ -926,7 +924,7 @@ public int executeUpdate(com.blazebit.persistence.spi.ServiceProvider servicePro for (Query participatingQuery : participatingQueries) { CacheableSqmInterpretation interpretation = buildQueryPlan(participatingQuery); JdbcTranslation translation = getJdbcTranslation(sessionFactory, interpretation, participatingQuery.unwrap(SqmQueryImpl.class)); - JdbcOperationQuery jdbcOperation = translation.query; + JdbcOperation jdbcOperation = translation.query; parameterBinders.addAll(jdbcOperation.getParameterBinders()); affectedTableNames.addAll(jdbcOperation.getAffectedTableNames()); final JdbcParameterBindings tempJdbcParameterBindings = translation.parameterBindings; @@ -1008,7 +1006,7 @@ public ReturningResult executeReturning(com.blazebit.persistence.spi.S for (Query participatingQuery : participatingQueries) { CacheableSqmInterpretation interpretation = buildQueryPlan(participatingQuery); JdbcTranslation translation = getJdbcTranslation(sessionFactory, interpretation, participatingQuery.unwrap(SqmQueryImpl.class)); - JdbcOperationQuery jdbcOperation = translation.query; + JdbcOperation jdbcOperation = translation.query; // Exclude limit/offset parameters from example query if (participatingQuery != exampleQuery) { parameterBinders.addAll(jdbcOperation.getParameterBinders()); @@ -1022,7 +1020,7 @@ public ReturningResult executeReturning(com.blazebit.persistence.spi.S } // Create plan for example query - JdbcOperationQuery exampleQueryJdbcOperation = getJdbcOperation(exampleQuery); + JdbcOperation exampleQueryJdbcOperation = getJdbcOperation(exampleQuery); StringBuilder sqlSb = new StringBuilder(sqlOverride.length() + 100); sqlSb.append(sqlOverride); @@ -1046,9 +1044,8 @@ public ReturningResult executeReturning(com.blazebit.persistence.spi.S // todo: avoid double translation CacheableSqmInterpretation interpretation = buildQueryPlan(exampleQuery); DomainQueryExecutionContext domainQueryExecutionContext = exampleQuery.unwrap(DomainQueryExecutionContext.class); - final JdbcOperationQuery jdbcSelect = sqlAstTranslatorFactory.buildSelectTranslator(sessionFactory, (SelectStatement) interpretation.getSqmTranslation().getSqlAst()) - .translate(jdbcParameterBindings, domainQueryExecutionContext.getQueryOptions()); - final JdbcOperationQuery realJdbcSelect = hibernateAccess.createFullJdbcSelect( + final JdbcOperation jdbcSelect = hibernateAccess.translateJdbcSelect( sessionFactory, (SelectStatement) interpretation.getSqmTranslation().getSqlAst(), jdbcParameterBindings, domainQueryExecutionContext.getQueryOptions()); + final JdbcOperation realJdbcSelect = hibernateAccess.createFullJdbcSelect( finalSql, parameterBinders, jdbcSelect, @@ -1260,7 +1257,7 @@ private static String trim(StringBuilder sb) { // } // - private JdbcOperationQuery getJdbcOperation(Query query) { + private JdbcOperation getJdbcOperation(Query query) { SqmQueryImpl hqlQuery = query.unwrap(SqmQueryImpl.class); SessionFactoryImplementor factory = hqlQuery.getSessionFactory(); // if (hqlQuery.getSqmStatement() instanceof SqmSelectStatement) { @@ -1279,15 +1276,15 @@ private JdbcOperationQuery getJdbcOperation(Query query) { return getJdbcOperation( factory, interpretation, hqlQuery ); } - private JdbcOperationQuery getJdbcOperation(SessionFactoryImplementor factory, CacheableSqmInterpretation interpretation, SqmQueryImpl query) { + private JdbcOperation getJdbcOperation(SessionFactoryImplementor factory, CacheableSqmInterpretation interpretation, SqmQueryImpl query) { return getJdbcTranslation( factory, interpretation, query ).query; } private static class JdbcTranslation { - private final JdbcOperationQuery query; + private final JdbcOperation query; private final JdbcParameterBindings parameterBindings; - public JdbcTranslation(JdbcOperationQuery query, JdbcParameterBindings parameterBindings) { + public JdbcTranslation(JdbcOperation query, JdbcParameterBindings parameterBindings) { this.query = query; this.parameterBindings = parameterBindings; } @@ -1319,8 +1316,7 @@ public MappingModelExpressible getResolvedMappingModelType(SqmParameter translator = sqlAstTranslatorFactory.buildSelectTranslator(factory, (SelectStatement) sqlAst); - return new JdbcTranslation(translator.translate(jdbcParameterBindings, query.getQueryOptions()), jdbcParameterBindings); + return new JdbcTranslation(hibernateAccess.translateJdbcSelect(factory, (SelectStatement) sqlAst, jdbcParameterBindings, query.getQueryOptions()), jdbcParameterBindings); } else if (sqlAst instanceof DeleteStatement) { SqlAstTranslator translator = sqlAstTranslatorFactory.buildMutationTranslator(factory, (DeleteStatement) sqlAst); return new JdbcTranslation(translator.translate(jdbcParameterBindings, query.getQueryOptions()), jdbcParameterBindings); diff --git a/integration/quarkus-3/deployment/pom.xml b/integration/quarkus-3/deployment/pom.xml index 579b433471..94a680cb3e 100644 --- a/integration/quarkus-3/deployment/pom.xml +++ b/integration/quarkus-3/deployment/pom.xml @@ -1010,5 +1010,123 @@ + + hibernate-7.3 + + + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate70,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate72 + 7 + 7.2 + + + + jakarta.persistence + jakarta.persistence-api + ${version.jakarta-jpa-3.2-api} + test + + + org.hibernate.orm + hibernate-core + ${version.hibernate-7.2} + test + + + ${project.groupId} + blaze-persistence-entity-view-processor-jakarta + ${project.version} + provided + + + + + + org.bsc.maven + maven-processor-plugin + + + process-test + + process-test + + generate-test-sources + + + ${project.build.directory}/test-metamodel + + + + com.blazebit.persistence.view.processor.EntityViewAnnotationProcessor + + + + false + version + java.lang.Long + + + + + + + ${project.groupId} + blaze-persistence-entity-view-processor-jakarta + ${project.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jakarta-jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jakarta-jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jakarta-jta} + + + jakarta.activation + jakarta.activation-api + ${version.jakarta-activation} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-test-source-metamodel + generate-test-sources + + add-test-source + + + + ${project.build.directory}/test-metamodel + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + + org.jboss.logmanager.LogManager + + true + + + + + + \ No newline at end of file diff --git a/integration/quarkus-3/pom.xml b/integration/quarkus-3/pom.xml index 068b25ae88..f490802187 100644 --- a/integration/quarkus-3/pom.xml +++ b/integration/quarkus-3/pom.xml @@ -110,5 +110,13 @@ 3.4.0 + + hibernate-7.3 + + ${version.jakarta-jpa-3.2-api} + ${version.quarkus-3.32} + 3.4.0 + + \ No newline at end of file diff --git a/integration/querydsl/testsuite/pom.xml b/integration/querydsl/testsuite/pom.xml index 16c732a5ed..07d974b9a6 100644 --- a/integration/querydsl/testsuite/pom.xml +++ b/integration/querydsl/testsuite/pom.xml @@ -2121,6 +2121,123 @@ + + hibernate-7.3 + + + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 + + + + org.hibernate + hibernate-core + ${version.hibernate-5.6} + + + ${project.groupId} + blaze-persistence-integration-hibernate-6.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate + compile + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + provided + + + + + + maven-surefire-plugin + + true + + + + maven-jar-plugin + + + + test-jar + + + + + + org.bsc.maven + maven-processor-plugin + + + process + + process + + generate-sources + + + ${project.build.directory}/generated-sources/metamodel + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + + + + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jta} + + + jakarta.activation + jakarta.activation-api + ${version.activation} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/metamodel + + + + + + + + eclipselink diff --git a/integration/spring-data/testsuite/webflux-jakarta-runner/pom.xml b/integration/spring-data/testsuite/webflux-jakarta-runner/pom.xml index 6c8bf0aaba..72196ecd35 100644 --- a/integration/spring-data/testsuite/webflux-jakarta-runner/pom.xml +++ b/integration/spring-data/testsuite/webflux-jakarta-runner/pom.xml @@ -400,6 +400,30 @@ + + hibernate-7.3 + + ${version.hibernate-7.3} + + + + jakarta.persistence + jakarta.persistence-api + ${version.jakarta-jpa-3.2-api} + + + ${project.groupId} + blaze-persistence-integration-hibernate-7.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate7 + ${project.version} + compile + + + spring-data-2.7.x + + 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 + + + + org.hibernate + hibernate-core + ${version.hibernate-5.6} + + + ${project.groupId} + blaze-persistence-integration-hibernate-6.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate + compile + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + provided + + + + + + maven-surefire-plugin + + true + + + + maven-jar-plugin + + + + test-jar + + + + + + org.bsc.maven + maven-processor-plugin + + + process + + process + + generate-sources + + + ${project.build.directory}/generated-sources/metamodel + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + + + + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jta} + + + jakarta.activation + jakarta.activation-api + ${version.activation} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/metamodel + + + + + + + + eclipselink diff --git a/integration/spring-data/testsuite/webmvc-jakarta-runner/pom.xml b/integration/spring-data/testsuite/webmvc-jakarta-runner/pom.xml index d4dea69d97..633d9e91bf 100644 --- a/integration/spring-data/testsuite/webmvc-jakarta-runner/pom.xml +++ b/integration/spring-data/testsuite/webmvc-jakarta-runner/pom.xml @@ -392,6 +392,30 @@ + + hibernate-7.3 + + ${version.hibernate-7.3} + + + + jakarta.persistence + jakarta.persistence-api + ${version.jakarta-jpa-3.2-api} + + + ${project.groupId} + blaze-persistence-integration-hibernate-7.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate7 + ${project.version} + compile + + + spring-data-2.7.x + + 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 + + + + org.hibernate + hibernate-core + ${version.hibernate-5.6} + + + ${project.groupId} + blaze-persistence-integration-hibernate-6.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate + compile + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + provided + + + + + + maven-surefire-plugin + + true + + + + maven-jar-plugin + + + + test-jar + + + + + + org.bsc.maven + maven-processor-plugin + + + process + + process + + generate-sources + + + ${project.build.directory}/generated-sources/metamodel + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + + + + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jta} + + + jakarta.activation + jakarta.activation-api + ${version.activation} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/metamodel + + + + + + + + eclipselink diff --git a/integration/spring-hateoas/webmvc-jakarta/pom.xml b/integration/spring-hateoas/webmvc-jakarta/pom.xml index 77e016e29a..05d1b08b05 100644 --- a/integration/spring-hateoas/webmvc-jakarta/pom.xml +++ b/integration/spring-hateoas/webmvc-jakarta/pom.xml @@ -363,6 +363,15 @@ 7 + + hibernate-7.3 + + ${version.jakarta-jpa-3.2-api} + ${version.hibernate-7.3} + 7.2 + 7 + + spring-data-2.7.x + + org.hibernate.orm + hibernate-jpamodelgen + ${version.hibernate-7.3} + provided + + + diff --git a/jpa-criteria/testsuite/pom.xml b/jpa-criteria/testsuite/pom.xml index c1c6d84f80..cc63e8716b 100644 --- a/jpa-criteria/testsuite/pom.xml +++ b/jpa-criteria/testsuite/pom.xml @@ -1881,6 +1881,123 @@ + + hibernate-7.3 + + + com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate60,com.blazebit.persistence.testsuite.base.jpa.category.NoHibernate66 + + + + org.hibernate + hibernate-core + ${version.hibernate-5.6} + + + ${project.groupId} + blaze-persistence-integration-hibernate-6.2 + test + + + ${project.groupId} + blaze-persistence-testsuite-base-hibernate + test + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + provided + + + + + + maven-surefire-plugin + + true + + + + maven-jar-plugin + + + + test-jar + + + + + + org.bsc.maven + maven-processor-plugin + + + process-test + + process-test + + generate-test-sources + + + ${project.build.directory}/test-metamodel + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + + + + + + + org.hibernate + hibernate-jpamodelgen + ${version.hibernate-5.6} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${version.jaxb-api} + + + com.sun.xml.bind + jaxb-impl + ${version.jaxb} + + + jakarta.transaction + jakarta.transaction-api + ${version.jta} + + + jakarta.activation + jakarta.activation-api + ${version.activation} + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-test-source-metamodel + generate-test-sources + + add-test-source + + + + ${project.build.directory}/test-metamodel + + + + + + + + eclipselink diff --git a/jpa-criteria/testsuite/src/test/java/com/blazebit/persistence/criteria/WhereTest.java b/jpa-criteria/testsuite/src/test/java/com/blazebit/persistence/criteria/WhereTest.java index 5b14c11ed4..aded7750ed 100644 --- a/jpa-criteria/testsuite/src/test/java/com/blazebit/persistence/criteria/WhereTest.java +++ b/jpa-criteria/testsuite/src/test/java/com/blazebit/persistence/criteria/WhereTest.java @@ -418,7 +418,8 @@ public void inParameterNotEqualGtLtCaseWhenAllSubquery() { BlazeSubquery subquery = cq.subquery(Timestamp.class); Root subRoot = subquery.from(Document.class, "subDoc"); - subquery.select(subRoot.get(Document_.lastModified).as(Timestamp.class)); + Path lastModifiedPath = subRoot.get(Document_.lastModified); + subquery.select(lastModifiedPath.as(Timestamp.class)); cq.select(root.get(Document_.id)); cq.where( @@ -436,7 +437,7 @@ public void inParameterNotEqualGtLtCaseWhenAllSubquery() { CriteriaBuilder criteriaBuilder = cq.createCriteriaBuilder(em); String castedPath = "subDoc.lastModified"; - if (!optimizesUnnecessaryCasts()) { + if (lastModifiedPath.getJavaType() != Timestamp.class) { castedPath = function("CAST_TIMESTAMP", castedPath); } String queryString = "SELECT document.id FROM Document document WHERE document.id IN " + listParameter("generated_param_0") + " OR document.id <> :idParam OR " + function("YEAR", "document.creationDate") + " > :generated_param_1 OR " + function("CAST_TIMESTAMP", "CASE WHEN document.age > :generated_param_2 THEN document.creationDate ELSE CURRENT_TIMESTAMP END") diff --git a/parent/pom.xml b/parent/pom.xml index 341d037480..862792d8af 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -70,6 +70,7 @@ 6.6.45.Final 7.1.20.Final 7.2.7.Final + 7.3.0.Final 4.1.17 4.1.19 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 36a9974460..2b1bd3bd7b 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 @@ -152,11 +152,6 @@ protected boolean supportsNestedEmbeddables() { return true; } - @Override - protected boolean optimizesUnnecessaryCasts() { - return getJpaProviderMajorVersion() > 6 || getJpaProviderMajorVersion() == 6 && getJpaProviderMinorVersion() >= 3; - } - @Override public boolean supportsTableGroupJoins() { return true; diff --git a/testsuite-base/hibernate7/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java b/testsuite-base/hibernate7/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java index 36a9974460..2b1bd3bd7b 100644 --- a/testsuite-base/hibernate7/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java +++ b/testsuite-base/hibernate7/src/main/java/com/blazebit/persistence/testsuite/base/AbstractPersistenceTest.java @@ -152,11 +152,6 @@ protected boolean supportsNestedEmbeddables() { return true; } - @Override - protected boolean optimizesUnnecessaryCasts() { - return getJpaProviderMajorVersion() > 6 || getJpaProviderMajorVersion() == 6 && getJpaProviderMinorVersion() >= 3; - } - @Override public boolean supportsTableGroupJoins() { 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 09e9a19860..8aae2107a1 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 @@ -676,10 +676,6 @@ protected boolean supportsCollectionTableCteDelete() { return false; } - protected boolean optimizesUnnecessaryCasts() { - return false; - } - protected boolean recreateDataSource() { return false; }