From 32c8977406d8219e87a0a024410f46dd218dfa0c Mon Sep 17 00:00:00 2001 From: Gavin Date: Wed, 11 Jan 2023 12:17:13 +0100 Subject: [PATCH] deprecate layer-breaking method SessionFactory.getSessionFactoryOptions() --- .../java/org/hibernate/SessionFactory.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/SessionFactory.java b/hibernate-core/src/main/java/org/hibernate/SessionFactory.java index 756ba7e0b1..0202b6244a 100644 --- a/hibernate-core/src/main/java/org/hibernate/SessionFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/SessionFactory.java @@ -117,13 +117,6 @@ import jakarta.persistence.EntityManagerFactory; * @author Steve Ebersole */ public interface SessionFactory extends EntityManagerFactory, Referenceable, Serializable, java.io.Closeable { - /** - * Get the special options used to build the factory. - * - * @return The special options used to build the factory. - */ - SessionFactoryOptions getSessionFactoryOptions(); - /** * Obtain a {@linkplain SessionBuilder session builder} for creating * new {@link Session}s with certain customized options. @@ -410,4 +403,15 @@ public interface SessionFactory extends EntityManagerFactory, Referenceable, Ser return getDefinedFilterNames().contains( name ); } + /** + * Get the {@linkplain SessionFactoryOptions options} used to build this factory. + * + * @return The special options used to build the factory. + * + * @deprecated There is no plan to remove this operation, but its use should be + * avoided since {@link SessionFactoryOptions} is an SPI type, and so + * this operation is a layer-breaker. + */ + @Deprecated(since = "6.2") + SessionFactoryOptions getSessionFactoryOptions(); }