Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 67874eb

Browse files
HHH-12185 - Simplify SessionFactoryBuilder / SessionFactoryOptions handling
Option #2 - SessionFactoryOptionsBuilder as SessionFactoryOptions
1 parent 7baa9e4 commit 67874eb

File tree

3 files changed

+14
-805
lines changed

3 files changed

+14
-805
lines changed

‎hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
*
129129
* @author Steve Ebersole
130130
*/
131-
public class SessionFactoryOptionsBuilder implements SessionFactoryOptionsState {
131+
public class SessionFactoryOptionsBuilder implements SessionFactoryOptions {
132132
private static final Logger log = Logger.getLogger( SessionFactoryOptionsBuilder.class );
133133

134134
private final StandardServiceRegistry serviceRegistry;
@@ -227,7 +227,7 @@ public class SessionFactoryOptionsBuilder implements SessionFactoryOptionsState
227227

228228
private boolean failOnPaginationOverCollectionFetchEnabled;
229229

230-
@SuppressWarnings("WeakerAccess")
230+
@SuppressWarnings({"WeakerAccess", "deprecation"})
231231
public SessionFactoryOptionsBuilder(StandardServiceRegistry serviceRegistry) {
232232
this.serviceRegistry = serviceRegistry;
233233

@@ -457,6 +457,7 @@ else if ( jdbcTimeZoneValue != null ) {
457457
);
458458
}
459459

460+
@SuppressWarnings("deprecation")
460461
private static Interceptor determineInterceptor(Map configurationSettings, StrategySelector strategySelector) {
461462
Object setting = configurationSettings.get( INTERCEPTOR );
462463
if ( setting == null ) {
@@ -476,7 +477,7 @@ private static Interceptor determineInterceptor(Map configurationSettings, Strat
476477
);
477478
}
478479

479-
@SuppressWarnings("unchecked")
480+
@SuppressWarnings({"unchecked", "deprecation"})
480481
private static Supplier<? extends Interceptor> determineStatelessInterceptor(
481482
Map configurationSettings,
482483
StrategySelector strategySelector) {
@@ -524,6 +525,7 @@ private static Supplier<? extends Interceptor> interceptorSupplier(Class<? exten
524525
};
525526
}
526527

528+
@SuppressWarnings("deprecation")
527529
private PhysicalConnectionHandlingMode interpretConnectionHandlingMode(
528530
Map configurationSettings,
529531
StandardServiceRegistry serviceRegistry) {
@@ -552,6 +554,7 @@ private PhysicalConnectionHandlingMode interpretConnectionHandlingMode(
552554
return transactionCoordinatorBuilder.getDefaultConnectionHandlingMode();
553555
}
554556

557+
@SuppressWarnings("deprecation")
555558
private PhysicalConnectionHandlingMode interpretConnectionHandlingMode(
556559
ConnectionAcquisitionMode specifiedAcquisitionMode,
557560
ConnectionReleaseMode specifiedReleaseMode,
@@ -770,11 +773,6 @@ public Map getQuerySubstitutions() {
770773
return querySubstitutions;
771774
}
772775

773-
@Override
774-
public boolean isStrictJpaQueryLanguageCompliance() {
775-
return jpaCompliance.isJpaQueryComplianceEnabled();
776-
}
777-
778776
@Override
779777
public boolean isNamedQueryStartupCheckingEnabled() {
780778
return namedQueryStartupCheckingEnabled;
@@ -876,15 +874,20 @@ public PhysicalConnectionHandlingMode getPhysicalConnectionHandlingMode() {
876874
}
877875

878876
@Override
879-
public booleanconnectionProviderDisablesAutoCommit() {
880-
returnconnectionProviderDisablesAutoCommit;
877+
public voidsetCheckNullability(booleanenabled) {
878+
this.checkNullability = enabled;
881879
}
882880

883881
@Override
884882
public ConnectionReleaseMode getConnectionReleaseMode() {
885883
return getPhysicalConnectionHandlingMode().getReleaseMode();
886884
}
887885

886+
@Override
887+
public boolean doesConnectionProviderDisableAutoCommit() {
888+
return connectionProviderDisablesAutoCommit;
889+
}
890+
888891
@Override
889892
public boolean isCommentsEnabled() {
890893
return commentsEnabled;
@@ -1226,7 +1229,7 @@ public void enableJdbcStyleParamsZeroBased() {
12261229
}
12271230

12281231
public SessionFactoryOptions buildOptions() {
1229-
return newSessionFactoryOptionsImpl( this );
1232+
return this;
12301233
}
12311234

12321235
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /