Skip to content

Commit

Permalink
HHH-18391 Check embeddable properties in fetch paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel committed Aug 7, 2024
1 parent e63c7f8 commit ecd22c0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -175,7 +176,8 @@ public EmbeddableInitializer<?> createInitializer(InitializerParent<?> parent, A

@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
Expand Down

0 comments on commit ecd22c0

Please sign in to comment.