From f91fe0335276896cafcdf841f1ec9d8cbbfb1417 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Fri, 11 Jun 2021 11:52:01 -0500 Subject: [PATCH] HHH-14679 - Deprecate ResultSetWrapper and friends --- .../hibernate/boot/internal/SessionFactoryOptionsBuilder.java | 1 + .../java/org/hibernate/boot/spi/SessionFactoryOptions.java | 4 ++++ .../src/main/java/org/hibernate/cfg/AvailableSettings.java | 3 +++ .../main/java/org/hibernate/engine/jdbc/ColumnNameCache.java | 3 +++ .../java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java | 3 +++ .../hibernate/engine/jdbc/internal/ResultSetWrapperImpl.java | 4 +++- .../java/org/hibernate/engine/jdbc/spi/ResultSetWrapper.java | 3 +++ 7 files changed, 20 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java index 7ddff3bf79..2f8bf765a9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java @@ -1273,6 +1273,7 @@ public class SessionFactoryOptionsBuilder implements SessionFactoryOptions { this.scrollableResultSetsEnabled = enabled; } + @Deprecated public void enableResultSetWrappingSupport(boolean enabled) { this.wrapResultSetsEnabled = enabled; } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java index df6e62f99c..632abf1cb9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java @@ -219,6 +219,10 @@ public interface SessionFactoryOptions { boolean isScrollableResultSetsEnabled(); + /** + * @deprecated (since 5.5) Scheduled for removal in 6.0 as ResultSet wrapping is no longer needed + */ + @Deprecated boolean isWrapResultSetsEnabled(); boolean isGetGeneratedKeysEnabled(); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java index 51e765ebd0..a40320d3b7 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java @@ -1114,7 +1114,10 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { /** * Enable wrapping of JDBC result sets in order to speed up column name lookups for * broken JDBC drivers + * + * @deprecated (since 5.5) Scheduled for removal in 6.0 as ResultSet wrapping is no longer needed */ + @Deprecated String WRAP_RESULT_SETS = "hibernate.jdbc.wrap_result_sets"; /** diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ColumnNameCache.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ColumnNameCache.java index b231a00e0a..52897f8b18 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ColumnNameCache.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ColumnNameCache.java @@ -13,8 +13,11 @@ import java.util.concurrent.ConcurrentHashMap; /** * Cache of column-name -> column-index resolutions * + * @deprecated (since 5.5) Scheduled for removal in 6.0 as ResultSet wrapping is no longer needed + * * @author Steve Ebersole */ +@Deprecated public final class ColumnNameCache { private static final float LOAD_FACTOR = .75f; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java index d179c0af9c..6db6cc63a3 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ResultSetWrapperProxy.java @@ -27,9 +27,12 @@ import org.hibernate.service.ServiceRegistry; * A proxy for a ResultSet delegate, responsible for locally caching the columnName-to-columnIndex resolution that * has been found to be inefficient in a few vendor's drivers (i.e., Oracle and Postgres). * + * @deprecated (since 5.5) Scheduled for removal in 6.0 as ResultSet wrapping is no longer needed + * * @author Steve Ebersole * @author Gail Badner */ +@Deprecated public class ResultSetWrapperProxy implements InvocationHandler { private static final CoreMessageLogger LOG = messageLogger( ResultSetWrapperProxy.class ); diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/ResultSetWrapperImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/ResultSetWrapperImpl.java index 46eacc8810..4f267c9a00 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/ResultSetWrapperImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/ResultSetWrapperImpl.java @@ -8,7 +8,6 @@ package org.hibernate.engine.jdbc.internal; import java.sql.ResultSet; -import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; import org.hibernate.engine.jdbc.ColumnNameCache; import org.hibernate.engine.jdbc.ResultSetWrapperProxy; import org.hibernate.engine.jdbc.spi.ResultSetWrapper; @@ -18,9 +17,12 @@ import org.hibernate.service.ServiceRegistry; * Standard Hibernate implementation for wrapping a {@link ResultSet} in a " column name cache" wrapper. * + * @deprecated (since 5.5) Scheduled for removal in 6.0 as ResultSet wrapping is no longer needed + * * @author Steve Ebersole * @author Gail Badner */ +@Deprecated public class ResultSetWrapperImpl implements ResultSetWrapper { private final ServiceRegistry serviceRegistry; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/ResultSetWrapper.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/ResultSetWrapper.java index 355bbc7857..59e99686a9 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/ResultSetWrapper.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/ResultSetWrapper.java @@ -13,8 +13,11 @@ import org.hibernate.engine.jdbc.ColumnNameCache; /** * Contract for wrapping a {@link ResultSet} in a "column name cache" wrapper. * + * @deprecated (since 5.5) Scheduled for removal in 6.0 as ResultSet wrapping is no longer needed + * * @author Gail Badner */ +@Deprecated public interface ResultSetWrapper { /** * Wrap a result set in a "column name cache" wrapper.