@@ -22,15 +22,15 @@ public partial class BatchFetchQueue
22
22
/// type at a time.
23
23
/// </remarks>
24
24
private readonly IDictionary < string , LinkedHashSet < EntityKey > > batchLoadableEntityKeys = new Dictionary < string , LinkedHashSet < EntityKey > > ( 8 ) ;
25
-
25
+
26
26
/// <summary>
27
27
/// A map of <see cref="SubselectFetch">subselect-fetch descriptors</see>
28
28
/// keyed by the <see cref="EntityKey" /> against which the descriptor is
29
29
/// registered.
30
30
/// </summary>
31
31
private readonly IDictionary < EntityKey , SubselectFetch > subselectsByEntityKey = new Dictionary < EntityKey , SubselectFetch > ( 8 ) ;
32
32
33
- private readonly IDictionary < string , LinkedHashMap < CollectionEntry , IPersistentCollection > > batchLoadableCollections = new Dictionary < string , LinkedHashMap < CollectionEntry , IPersistentCollection > > ( 8 ) ;
33
+ private readonly IDictionary < string , LinkedHashMap < CollectionEntry , IPersistentCollection > > batchLoadableCollections = new Dictionary < string , LinkedHashMap < CollectionEntry , IPersistentCollection > > ( 8 ) ;
34
34
/// <summary>
35
35
/// The owning persistence context.
36
36
/// </summary>
@@ -155,7 +155,7 @@ public void AddBatchLoadableCollection(IPersistentCollection collection, Collect
155
155
map = new LinkedHashMap < CollectionEntry , IPersistentCollection > ( ) ;
156
156
batchLoadableCollections . Add ( persister . Role , map ) ;
157
157
}
158
- map [ ce ] = collection ;
158
+ map [ ce ] = collection ;
159
159
}
160
160
161
161
/// <summary>
@@ -189,7 +189,7 @@ public object[] GetCollectionBatch(ICollectionPersister collectionPersister, obj
189
189
190
190
if ( batchLoadableCollections . TryGetValue ( collectionPersister . Role , out var map ) )
191
191
{
192
- foreach ( KeyValuePair < CollectionEntry , IPersistentCollection > me in map )
192
+ foreach ( KeyValuePair < CollectionEntry , IPersistentCollection > me in map )
193
193
{
194
194
var ce = me . Key ;
195
195
var collection = me . Value ;
@@ -205,11 +205,7 @@ public object[] GetCollectionBatch(ICollectionPersister collectionPersister, obj
205
205
206
206
if ( collection . WasInitialized )
207
207
{
208
- // should never happen
209
- if ( log . IsWarnEnabled ( ) )
210
- {
211
- log . Warn ( "Encountered initialized collection in BatchFetchQueue, this should not happen." ) ;
212
- }
208
+ log . Warn ( "Encountered initialized collection in BatchFetchQueue, this should not happen." ) ;
213
209
continue ;
214
210
}
215
211
@@ -245,7 +241,7 @@ public object[] GetCollectionBatch(ICollectionPersister collectionPersister, obj
245
241
}
246
242
}
247
243
}
248
-
244
+
249
245
return keys ; //we ran out of keys to try
250
246
}
251
247
@@ -258,15 +254,15 @@ public object[] GetCollectionBatch(ICollectionPersister collectionPersister, obj
258
254
/// <param name="id">The identifier of the entity currently demanding load.</param>
259
255
/// <param name="batchSize">The maximum number of keys to return</param>
260
256
/// <returns>an array of identifiers, of length batchSize (possibly padded with nulls)</returns>
261
- public object [ ] GetEntityBatch ( IEntityPersister persister , object id , int batchSize )
257
+ public object [ ] GetEntityBatch ( IEntityPersister persister , object id , int batchSize )
262
258
{
263
259
object [ ] ids = new object [ batchSize ] ;
264
260
ids [ 0 ] = id ; //first element of array is reserved for the actual instance we are loading!
265
261
int i = 1 ;
266
262
int end = - 1 ;
267
263
bool checkForEnd = false ;
268
264
269
- if ( batchLoadableEntityKeys . TryGetValue ( persister . EntityName , out var set ) ) //TODO: this needn't exclude subclasses...
265
+ if ( batchLoadableEntityKeys . TryGetValue ( persister . EntityName , out var set ) )
270
266
{
271
267
foreach ( var key in set )
272
268
{
0 commit comments