From 904ab4f188b30cdf68c6db8bc01068b8da6c44d4 Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Wed, 5 Jun 2024 15:02:03 +0200 Subject: [PATCH] [#1935] Fixes for Hibernate ORM 6.5.3.Final --- .../ReactiveToOneAttributeMapping.java | 5 +++++ ...veInformationSchemaBasedExtractorImpl.java | 19 +++++++++++++++++++ .../ReactiveConnectionPoolTest.java | 6 ++++++ 3 files changed, 30 insertions(+) diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/metamodel/mapping/internal/ReactiveToOneAttributeMapping.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/metamodel/mapping/internal/ReactiveToOneAttributeMapping.java index 3acdff04ca..09acc9bb98 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/metamodel/mapping/internal/ReactiveToOneAttributeMapping.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/metamodel/mapping/internal/ReactiveToOneAttributeMapping.java @@ -97,4 +97,9 @@ public ReactiveToOneAttributeMapping copy( TableGroupProducer declaringTableGroupProducer) { return new ReactiveToOneAttributeMapping( super.copy( declaringType, declaringTableGroupProducer ) ); } + + @Override + protected Object lazyInitialize(Object domainValue) { + return domainValue; + } } diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/provider/service/AbstractReactiveInformationSchemaBasedExtractorImpl.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/provider/service/AbstractReactiveInformationSchemaBasedExtractorImpl.java index 5daafc28e2..8ba013cb56 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/provider/service/AbstractReactiveInformationSchemaBasedExtractorImpl.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/provider/service/AbstractReactiveInformationSchemaBasedExtractorImpl.java @@ -5,6 +5,7 @@ */ package org.hibernate.reactive.provider.service; +import java.lang.invoke.MethodHandles; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; @@ -14,6 +15,8 @@ import org.hibernate.boot.model.TruthValue; import org.hibernate.boot.model.naming.DatabaseIdentifier; import org.hibernate.boot.model.naming.Identifier; +import org.hibernate.reactive.logging.impl.Log; +import org.hibernate.reactive.logging.impl.LoggerFactory; import org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl; import org.hibernate.tool.schema.extract.internal.ColumnInformationImpl; import org.hibernate.tool.schema.extract.spi.ColumnInformation; @@ -29,6 +32,8 @@ */ public abstract class AbstractReactiveInformationSchemaBasedExtractorImpl extends AbstractInformationExtractorImpl { + private static final Log LOG = LoggerFactory.make( Log.class, MethodHandles.lookup() ); + public AbstractReactiveInformationSchemaBasedExtractorImpl(ExtractionContext extractionContext) { super( extractionContext ); } @@ -154,6 +159,20 @@ protected T processCatalogsResultSet(ExtractionContext.ResultSetProcessor ); } + @Override + protected T processCrossReferenceResultSet( + String parentCatalog, + String parentSchema, + String parentTable, + String foreignCatalog, + String foreignSchema, + String foreignTable, + ExtractionContext.ResultSetProcessor processor) { + // This method has been added as fix for https://hibernate.atlassian.net/browse/HHH-18221 + // The issue is only for Informix that we don't currently support. + throw LOG.notYetImplemented(); + } + @Override protected T processSchemaResultSet( String catalog, diff --git a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/configuration/ReactiveConnectionPoolTest.java b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/configuration/ReactiveConnectionPoolTest.java index 1e755aa622..babae4bd47 100644 --- a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/configuration/ReactiveConnectionPoolTest.java +++ b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/configuration/ReactiveConnectionPoolTest.java @@ -12,6 +12,7 @@ import org.hibernate.engine.jdbc.internal.JdbcServicesImpl; import org.hibernate.engine.jdbc.spi.JdbcServices; +import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlStatementLogger; import org.hibernate.reactive.containers.DatabaseConfiguration; import org.hibernate.reactive.pool.ReactiveConnectionPool; @@ -64,6 +65,11 @@ private ReactiveConnectionPool configureAndStartPool(Map config) public SqlStatementLogger getSqlStatementLogger() { return new SqlStatementLogger(); } + + @Override + public SqlExceptionHelper getSqlExceptionHelper() { + return new SqlExceptionHelper( true ); + } } ); DefaultSqlClientPool reactivePool = new DefaultSqlClientPool(); reactivePool.injectServices( registryExtension.getServiceRegistry() );