Skip to content

Commit cb8630f

Browse files
committed
HHH-19267 Change scope of methods in JdbcEnvironmentInitiator
This way Hibernate Reactive can reuse the logic for determining the database version, or the dialect resolution info. Related to hibernate/hibernate-reactive#2129
1 parent b3f25d9 commit cb8630f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/JdbcEnvironmentInitiator.java

+13-2
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,17 @@ private DatabaseConnectionInfo buildDbInfo(Map<String, Object> configurationValu
174174
return new DatabaseConnectionInfoImpl( configurationValues, dialect );
175175
}
176176

177-
private static JdbcEnvironmentImpl getJdbcEnvironmentWithDefaults(
177+
// Used by Hibernate Reactive
178+
protected JdbcEnvironmentImpl getJdbcEnvironmentWithDefaults(
178179
Map<String, Object> configurationValues,
179180
ServiceRegistryImplementor registry,
180181
DialectFactory dialectFactory) {
181182
final Dialect dialect = dialectFactory.buildDialect( configurationValues, null );
182183
return new JdbcEnvironmentImpl( registry, dialect );
183184
}
184185

185-
private static JdbcEnvironmentImpl getJdbcEnvironmentWithExplicitConfiguration(
186+
// Used by Hibernate Reactive
187+
protected JdbcEnvironmentImpl getJdbcEnvironmentWithExplicitConfiguration(
186188
Map<String, Object> configurationValues,
187189
ServiceRegistryImplementor registry,
188190
DialectFactory dialectFactory,
@@ -203,6 +205,15 @@ private static JdbcEnvironmentImpl getJdbcEnvironmentWithExplicitConfiguration(
203205
null,
204206
configurationValues
205207
);
208+
return getJdbcEnvironmentWithExplicitConfiguration( configurationValues, registry, dialectFactory, dialectResolutionInfo );
209+
}
210+
211+
// Used by Hibernate Reactive
212+
protected JdbcEnvironmentImpl getJdbcEnvironmentWithExplicitConfiguration(
213+
Map<String, Object> configurationValues,
214+
ServiceRegistryImplementor registry,
215+
DialectFactory dialectFactory,
216+
DialectResolutionInfo dialectResolutionInfo) {
206217
final Dialect dialect = dialectFactory.buildDialect( configurationValues, () -> dialectResolutionInfo );
207218
return new JdbcEnvironmentImpl( registry, dialect );
208219
}

0 commit comments

Comments
 (0)