@@ -57,10 +57,9 @@ public EntityBatchLoaderInPredicate(
57
57
int idColumnCount =
58
58
entityDescriptor .getEntityPersister ().getIdentifierType ()
59
59
.getColumnSpan ( sessionFactory .getRuntimeMetamodels ());
60
- this .sqlBatchSize = sessionFactory .getJdbcServices ()
61
- .getDialect ()
62
- .getBatchLoadSizingStrategy ()
63
- .determineOptimalBatchLoadSize ( idColumnCount , domainBatchSize , false );
60
+ this .sqlBatchSize =
61
+ sessionFactory .getJdbcServices ().getDialect ().getBatchLoadSizingStrategy ()
62
+ .determineOptimalBatchLoadSize ( idColumnCount , domainBatchSize , false );
64
63
65
64
if ( MULTI_KEY_LOAD_LOGGER .isDebugEnabled () ) {
66
65
MULTI_KEY_LOAD_LOGGER .debugf (
@@ -128,10 +127,11 @@ protected void initializeEntities(
128
127
MULTI_KEY_LOAD_LOGGER .debugf ( "Ids to batch-fetch initialize (`%s#%s`) %s" ,
129
128
getLoadable ().getEntityName (), pkValue , Arrays .toString (idsToInitialize ) );
130
129
}
130
+ final EntityIdentifierMapping identifierMapping = getLoadable ().getIdentifierMapping ();
131
131
final MultiKeyLoadChunker <Object > chunker = new MultiKeyLoadChunker <>(
132
132
sqlBatchSize ,
133
- getLoadable (). getIdentifierMapping () .getJdbcTypeCount (),
134
- getLoadable (). getIdentifierMapping () ,
133
+ identifierMapping .getJdbcTypeCount (),
134
+ identifierMapping ,
135
135
jdbcParameters ,
136
136
sqlAst ,
137
137
jdbcSelectOperation
@@ -145,19 +145,18 @@ protected void initializeEntities(
145
145
sqlBatchSize ,
146
146
(jdbcParameterBindings , session1 ) -> {
147
147
// Create a RegistrationHandler for handling any subselect fetches we encounter handling this chunk
148
- final SubselectFetch .RegistrationHandler registrationHandler = SubselectFetch .createRegistrationHandler (
149
- batchFetchQueue ,
150
- sqlAst ,
151
- jdbcParameters ,
152
- jdbcParameterBindings
153
- );
154
148
return new SingleIdExecutionContext (
155
149
pkValue ,
156
150
entityInstance ,
157
151
getLoadable ().getRootEntityDescriptor (),
158
152
readOnly ,
159
153
lockOptions ,
160
- registrationHandler ,
154
+ SubselectFetch .createRegistrationHandler (
155
+ batchFetchQueue ,
156
+ sqlAst ,
157
+ jdbcParameters ,
158
+ jdbcParameterBindings
159
+ ),
161
160
session
162
161
);
163
162
},
0 commit comments