Restore collectionsInDefaultFetchGroupEnabled usage in LazyAttributesMetadata

This commit is contained in:
Christian Beikov 2020-11-26 15:11:33 +01:00 committed by Sanne Grinovero
parent b08fbdaa6e
commit e2dbf52abe
3 changed files with 8 additions and 5 deletions

View File

@ -34,7 +34,8 @@ public class LazyAttributesMetadata implements Serializable {
public static LazyAttributesMetadata from( public static LazyAttributesMetadata from(
PersistentClass mappedEntity, PersistentClass mappedEntity,
boolean isEnhanced, boolean isEnhanced,
boolean allowEnhancementAsProxy) { boolean allowEnhancementAsProxy,
boolean collectionsInDefaultFetchGroupEnabled) {
final Map<String, LazyAttributeDescriptor> lazyAttributeDescriptorMap = new LinkedHashMap<>(); final Map<String, LazyAttributeDescriptor> lazyAttributeDescriptorMap = new LinkedHashMap<>();
final Map<String, Set<String>> fetchGroupToAttributesMap = new HashMap<>(); final Map<String, Set<String>> fetchGroupToAttributesMap = new HashMap<>();
@ -48,7 +49,7 @@ public class LazyAttributesMetadata implements Serializable {
property, property,
isEnhanced, isEnhanced,
allowEnhancementAsProxy, allowEnhancementAsProxy,
false collectionsInDefaultFetchGroupEnabled
); );
if ( lazy ) { if ( lazy ) {
final LazyAttributeDescriptor lazyAttributeDescriptor = LazyAttributeDescriptor.from( property, i, x++ ); final LazyAttributeDescriptor lazyAttributeDescriptor = LazyAttributeDescriptor.from( property, i, x++ );

View File

@ -38,11 +38,12 @@ public final class BytecodeEnhancementMetadataPojoImpl implements BytecodeEnhanc
PersistentClass persistentClass, PersistentClass persistentClass,
Set<String> identifierAttributeNames, Set<String> identifierAttributeNames,
CompositeType nonAggregatedCidMapper, CompositeType nonAggregatedCidMapper,
boolean allowEnhancementAsProxy) { boolean allowEnhancementAsProxy,
boolean collectionsInDefaultFetchGroupEnabled) {
final Class mappedClass = persistentClass.getMappedClass(); final Class mappedClass = persistentClass.getMappedClass();
final boolean enhancedForLazyLoading = PersistentAttributeInterceptable.class.isAssignableFrom( mappedClass ); final boolean enhancedForLazyLoading = PersistentAttributeInterceptable.class.isAssignableFrom( mappedClass );
final LazyAttributesMetadata lazyAttributesMetadata = enhancedForLazyLoading final LazyAttributesMetadata lazyAttributesMetadata = enhancedForLazyLoading
? LazyAttributesMetadata.from( persistentClass, true, allowEnhancementAsProxy ) ? LazyAttributesMetadata.from( persistentClass, true, allowEnhancementAsProxy, collectionsInDefaultFetchGroupEnabled )
: LazyAttributesMetadata.nonEnhanced( persistentClass.getEntityName() ); : LazyAttributesMetadata.nonEnhanced( persistentClass.getEntityName() );
return new BytecodeEnhancementMetadataPojoImpl( return new BytecodeEnhancementMetadataPojoImpl(

View File

@ -169,7 +169,8 @@ public class EntityMetamodel implements Serializable {
persistentClass, persistentClass,
idAttributeNames, idAttributeNames,
nonAggregatedCidMapper, nonAggregatedCidMapper,
sessionFactoryOptions.isEnhancementAsProxyEnabled() sessionFactoryOptions.isEnhancementAsProxyEnabled(),
sessionFactoryOptions.isCollectionsInDefaultFetchGroupEnabled()
); );
} }
else { else {