HHH-18391 Check embeddable properties in fetch paths

This commit is contained in:
Marco Belladelli 2024-07-23 15:25:42 +02:00
parent e63c7f814a
commit ecd22c0811
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@
package org.hibernate.sql.results.graph.embeddable.internal;
import org.hibernate.engine.FetchTiming;
import org.hibernate.graph.spi.GraphHelper;
import org.hibernate.graph.spi.GraphImplementor;
import org.hibernate.metamodel.mapping.EmbeddableValuedModelPart;
import org.hibernate.metamodel.mapping.EmbeddableMappingType;
@ -175,7 +176,8 @@ public class EmbeddableFetchImpl extends AbstractFetchParent
@Override
public boolean appliesTo(GraphImplementor<?> graphImplementor, JpaMetamodel metamodel) {
return getFetchParent().appliesTo( graphImplementor, metamodel );
// We use managedType here since this fetch could correspond to an entity type if the embeddable is an id-class
return GraphHelper.appliesTo( graphImplementor, metamodel.managedType( getResultJavaType().getTypeName() ) );
}
@Override