Skip to content

Commit b485b74

Browse files
DavideDmbladel
authored andcommitted
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 73d8c67 commit b485b74

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
@@ -192,15 +192,17 @@ private DatabaseConnectionInfo buildInfo(Map<String, Object> configurationValues
192192
return new DatabaseConnectionInfoImpl( configurationValues, environment.getDialect() );
193193
}
194194

195-
private static JdbcEnvironmentImpl getJdbcEnvironmentWithDefaults(
195+
// Used by Hibernate Reactive
196+
protected JdbcEnvironmentImpl getJdbcEnvironmentWithDefaults(
196197
Map<String, Object> configurationValues,
197198
ServiceRegistryImplementor registry,
198199
DialectFactory dialectFactory) {
199200
final Dialect dialect = dialectFactory.buildDialect( configurationValues, null );
200201
return new JdbcEnvironmentImpl( registry, dialect );
201202
}
202203

203-
private static JdbcEnvironmentImpl getJdbcEnvironmentWithExplicitConfiguration(
204+
// Used by Hibernate Reactive
205+
protected JdbcEnvironmentImpl getJdbcEnvironmentWithExplicitConfiguration(
204206
Map<String, Object> configurationValues,
205207
ServiceRegistryImplementor registry,
206208
DialectFactory dialectFactory,
@@ -221,6 +223,15 @@ private static JdbcEnvironmentImpl getJdbcEnvironmentWithExplicitConfiguration(
221223
null,
222224
configurationValues
223225
);
226+
return getJdbcEnvironmentWithExplicitConfiguration( configurationValues, registry, dialectFactory, dialectResolutionInfo );
227+
}
228+
229+
// Used by Hibernate Reactive
230+
protected JdbcEnvironmentImpl getJdbcEnvironmentWithExplicitConfiguration(
231+
Map<String, Object> configurationValues,
232+
ServiceRegistryImplementor registry,
233+
DialectFactory dialectFactory,
234+
DialectResolutionInfo dialectResolutionInfo) {
224235
final Dialect dialect = dialectFactory.buildDialect( configurationValues, () -> dialectResolutionInfo );
225236
return new JdbcEnvironmentImpl( registry, dialect );
226237
}

0 commit comments

Comments
 (0)