HHH-16532 Fix NPE for @Any association fetches

This commit is contained in:
Marco Belladelli 2023-05-24 10:32:57 +02:00
parent a05e3cd2fa
commit 1c55a4766f
1 changed files with 3 additions and 2 deletions

View File

@ -885,8 +885,9 @@ public class LoaderSelectBuilder {
}
}
else if ( loadQueryInfluencers.getEnabledCascadingFetchProfile() != null ) {
final CascadeStyle cascadeStyle = fetchable.
asAttributeMapping().getAttributeMetadata().getCascadeStyle();
final CascadeStyle cascadeStyle = fetchable.asAttributeMapping() != null ?
fetchable.asAttributeMapping().getAttributeMetadata().getCascadeStyle() :
null;
final CascadingAction<?> cascadingAction =
loadQueryInfluencers.getEnabledCascadingFetchProfile().getCascadingAction();
if ( cascadeStyle == null || cascadeStyle.doCascade( cascadingAction ) ) {