From f086821abd3b49a4326891a7ddc57a3809fcd363 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Tue, 5 Mar 2019 23:06:31 +0000 Subject: [PATCH] HHH-13305 Deprecate public static helpers returning the current Dialect --- .../src/main/java/org/hibernate/dialect/Dialect.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index e3ad8f45b5..4f858eab41 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -249,10 +249,12 @@ protected Dialect() { /** * Get an instance of the dialect specified by the current System properties. + * @deprecated this static method will be removed. * * @return The specified Dialect * @throws HibernateException If no dialect was specified, or if it could not be instantiated. */ + @Deprecated public static Dialect getDialect() throws HibernateException { return instantiateDialect( Environment.getProperties().getProperty( Environment.DIALECT ) ); } @@ -260,11 +262,13 @@ public static Dialect getDialect() throws HibernateException { /** * Get an instance of the dialect specified by the given properties or by * the current System properties. + * @deprecated this static method will be removed. * * @param props The properties to use for finding the dialect class to use. * @return The specified Dialect * @throws HibernateException If no dialect was specified, or if it could not be instantiated. */ + @Deprecated public static Dialect getDialect(Properties props) throws HibernateException { final String dialectName = props.getProperty( Environment.DIALECT ); if ( dialectName == null ) { @@ -273,6 +277,10 @@ public static Dialect getDialect(Properties props) throws HibernateException { return instantiateDialect( dialectName ); } + /** + * @deprecated such static helpers will be removed + */ + @Deprecated private static Dialect instantiateDialect(String dialectName) throws HibernateException { if ( dialectName == null ) { throw new HibernateException( "The dialect was not set. Set the property hibernate.dialect." );