From 0f0f50de96c84800ea96b9a570bfe5bb41d1fd92 Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Tue, 17 Sep 2024 11:33:07 +0200 Subject: [PATCH] HHH-18617 Avoid reading unowned association key when filters are enabled --- .../metamodel/mapping/internal/ToOneAttributeMapping.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java index f79b92e60e..c360a0563a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java @@ -1587,8 +1587,7 @@ public class ToOneAttributeMapping } } else if ( hasNotFoundAction() - || getAssociatedEntityMappingType().getSoftDeleteMapping() != null - || affectedByEnabledFilters ) { + || getAssociatedEntityMappingType().getSoftDeleteMapping() != null ) { // For the target side only add keyResult when a not-found action is present keyResult = foreignKeyDescriptor.createTargetDomainResult( fetchablePath,