12
12
import org .hibernate .internal .SessionCreationOptions ;
13
13
import org .hibernate .internal .SessionFactoryImpl ;
14
14
import org .hibernate .reactive .common .spi .Implementor ;
15
- import org .hibernate .reactive .common .spi .MutinyImplementor ;
16
15
import org .hibernate .reactive .context .Context ;
17
16
import org .hibernate .reactive .context .impl .BaseKey ;
18
17
import org .hibernate .reactive .context .impl .MultitenantKey ;
40
39
* <p>
41
40
* Obtained by calling {@link org.hibernate.SessionFactory#unwrap(Class)}.
42
41
*/
43
- public class MutinySessionFactoryImpl implements Mutiny .SessionFactory , Implementor , MutinyImplementor {
42
+ public class MutinySessionFactoryImpl implements Mutiny .SessionFactory , Implementor {
44
43
45
44
private static final Log LOG = LoggerFactory .make ( Log .class , MethodHandles .lookup () );
46
45
@@ -85,24 +84,6 @@ public Context getContext() {
85
84
return context ;
86
85
}
87
86
88
- @ Override
89
- public Mutiny .Session newSession () {
90
- SessionCreationOptions options = options ();
91
- return new MutinySessionImpl (
92
- new ReactiveSessionImpl ( delegate , options , proxyConnection ( options .getTenantIdentifier () ) ),
93
- this
94
- );
95
- }
96
-
97
- @ Override
98
- public Mutiny .Session newSession (String tenantId ) {
99
- Objects .requireNonNull ( tenantId , "parameter 'tenantId' is required" );
100
- return new MutinySessionImpl (
101
- new ReactiveSessionImpl ( delegate , options ( tenantId ), proxyConnection ( tenantId ) ),
102
- this
103
- );
104
- }
105
-
106
87
@ Override
107
88
public Uni <Mutiny .Session > openSession () {
108
89
SessionCreationOptions options = options ();
@@ -128,23 +109,6 @@ private <S> Uni<S> create(ReactiveConnection connection, Supplier<S> supplier) {
128
109
.onFailure ().call ( () -> Uni .createFrom ().completionStage ( connection .close () ) );
129
110
}
130
111
131
- @ Override
132
- public Mutiny .StatelessSession newStatelessSession () {
133
- SessionCreationOptions options = options ();
134
- return new MutinyStatelessSessionImpl (
135
- new ReactiveStatelessSessionImpl ( delegate , options , proxyConnection ( options .getTenantIdentifier () ) ),
136
- this
137
- );
138
- }
139
-
140
- @ Override
141
- public Mutiny .StatelessSession newStatelessSession (String tenantId ) {
142
- return new MutinyStatelessSessionImpl (
143
- new ReactiveStatelessSessionImpl ( delegate , options ( tenantId ), proxyConnection ( tenantId ) ),
144
- this
145
- );
146
- }
147
-
148
112
@ Override
149
113
public Uni <Mutiny .StatelessSession > openStatelessSession () {
150
114
SessionCreationOptions options = options ();
@@ -167,7 +131,7 @@ private SessionCreationOptions options() {
167
131
}
168
132
169
133
private SessionCreationOptions options (String tenantIdentifier ) {
170
- return ( SessionCreationOptions ) new SessionFactoryImpl .SessionBuilderImpl ( delegate )
134
+ return new SessionFactoryImpl .SessionBuilderImpl ( delegate )
171
135
.tenantIdentifier ( tenantIdentifier );
172
136
}
173
137
@@ -178,13 +142,6 @@ private CompletionStage<ReactiveConnection> connection(String tenantId) {
178
142
: connectionPool .getConnection ( tenantId );
179
143
}
180
144
181
- private ReactiveConnection proxyConnection (String tenantId ) {
182
- assertUseOnEventLoop ();
183
- return tenantId ==null
184
- ? connectionPool .getProxyConnection ()
185
- : connectionPool .getProxyConnection ( tenantId );
186
- }
187
-
188
145
@ Override
189
146
public <T > Uni <T > withSession (Function <Mutiny .Session , Uni <T >> work ) {
190
147
Objects .requireNonNull ( work , "parameter 'work' is required" );
0 commit comments