HHH-15279 NPE with Id on OneToOne referencing entity with multi-level EmbeddedId

This commit is contained in:
Andrea Boriero 2022-05-18 14:58:45 +02:00 committed by Christian Beikov
parent 4066fe0445
commit 81d749e930
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import org.hibernate.metamodel.mapping.EmbeddableMappingType;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.metamodel.mapping.ManagedMappingType;
import org.hibernate.metamodel.mapping.ModelPart;
import org.hibernate.metamodel.mapping.PropertyBasedMapping;
import org.hibernate.metamodel.mapping.SelectableConsumer;
import org.hibernate.metamodel.mapping.SelectableMappings;
import org.hibernate.metamodel.model.domain.NavigableRole;
@ -142,7 +143,9 @@ public class EmbeddedAttributeMapping
null,
inverseModelPart.getMappedFetchOptions(),
keyDeclaringType,
null,
inverseModelPart instanceof PropertyBasedMapping ?
( (PropertyBasedMapping) inverseModelPart ).getPropertyAccess() :
null,
null
);