HHH-16651 improve probability of getting cached loader

This commit is contained in:
Gavin 2023-05-21 23:31:59 +02:00 committed by Gavin King
parent 8bf5bb0d98
commit f2017cd5a0
2 changed files with 6 additions and 2 deletions

View File

@ -309,7 +309,9 @@ public abstract class AbstractCollectionPersister
hasOrphanDelete = collectionBootDescriptor.hasOrphanDelete(); hasOrphanDelete = collectionBootDescriptor.hasOrphanDelete();
batchSize = collectionBootDescriptor.getBatchSize(); batchSize = collectionBootDescriptor.getBatchSize() < 0
? factory.getSessionFactoryOptions().getDefaultBatchFetchSize()
: collectionBootDescriptor.getBatchSize();
isVersioned = collectionBootDescriptor.isOptimisticLocked(); isVersioned = collectionBootDescriptor.isOptimisticLocked();

View File

@ -506,7 +506,9 @@ public abstract class AbstractEntityPersister
final Dialect dialect = creationContext.getDialect(); final Dialect dialect = creationContext.getDialect();
batchSize = persistentClass.getBatchSize(); batchSize = persistentClass.getBatchSize() < 0
? factory.getSessionFactoryOptions().getDefaultBatchFetchSize()
: persistentClass.getBatchSize();
hasSubselectLoadableCollections = persistentClass.hasSubselectLoadableCollections(); hasSubselectLoadableCollections = persistentClass.hasSubselectLoadableCollections();
hasPartitionedSelectionMapping = persistentClass.hasPartitionedSelectionMapping(); hasPartitionedSelectionMapping = persistentClass.hasPartitionedSelectionMapping();
hasCollectionNotReferencingPK = persistentClass.hasCollectionNotReferencingPK(); hasCollectionNotReferencingPK = persistentClass.hasCollectionNotReferencingPK();