@@ -84,9 +84,9 @@ public void setDialectResolver(DialectResolver dialectResolver) {
84
84
@ Override
85
85
public Dialect buildDialect (Map <String ,Object > configValues , DialectResolutionInfoSource resolutionInfoSource ) throws HibernateException {
86
86
final Object dialectReference = configValues .get ( AvailableSettings .DIALECT );
87
- Dialect dialect = !isEmpty ( dialectReference ) ?
88
- constructDialect ( dialectReference , resolutionInfoSource ) :
89
- determineDialect ( resolutionInfoSource );
87
+ Dialect dialect = !isEmpty ( dialectReference )
88
+ ? constructDialect ( dialectReference , resolutionInfoSource )
89
+ : determineDialect ( resolutionInfoSource );
90
90
logSelectedDialect ( dialect );
91
91
return dialect ;
92
92
}
@@ -105,6 +105,9 @@ private static void logSelectedDialect(Dialect dialect) {
105
105
DEPRECATION_LOGGER .deprecatedDialect ( dialectClass .getSimpleName () );
106
106
}
107
107
}
108
+ else if ( Dialect .class .getPackage () == dialectClass .getPackage () ) {
109
+ DEPRECATION_LOGGER .automaticDialect ( dialectClass .getSimpleName () );
110
+ }
108
111
}
109
112
110
113
@ SuppressWarnings ("SimplifiableIfStatement" )
@@ -129,7 +132,7 @@ private Dialect constructDialect(Object dialectReference, DialectResolutionInfoS
129
132
(dialectClass ) -> {
130
133
try {
131
134
try {
132
- if (resolutionInfoSource != null ) {
135
+ if ( resolutionInfoSource != null ) {
133
136
return dialectClass .getConstructor ( DialectResolutionInfo .class ).newInstance (
134
137
resolutionInfoSource .getDialectResolutionInfo ()
135
138
);
@@ -157,7 +160,7 @@ private Dialect constructDialect(Object dialectReference, DialectResolutionInfoS
157
160
final String dialectFqn = dialectReference .toString ();
158
161
if ( LEGACY_DIALECTS .contains ( dialectFqn ) ) {
159
162
throw new StrategySelectionException (
160
- "Couldn't load the dialect class for the ` hibernate.dialect` [" + dialectFqn + "], " +
163
+ "Couldn't load the dialect class for the ' hibernate.dialect' [" + dialectFqn + "], " +
161
164
"because the application is missing a dependency on the hibernate-community-dialects module. " +
162
165
"Hibernate 6.2 dropped support for database versions that are unsupported by vendors " +
163
166
"and code for old versions was moved to the hibernate-community-dialects module. " +
0 commit comments