HHH-16191 Fix eager associations not fetched with native queries
This commit is contained in:
parent
e3c3669114
commit
1f4f0c6ec1
|
@ -130,7 +130,7 @@ public class ImplicitFetchBuilderEntity implements ImplicitFetchBuilder {
|
|||
final Fetch fetch = parent.generateFetchableFetch(
|
||||
fetchable,
|
||||
fetchPath,
|
||||
FetchTiming.DELAYED,
|
||||
fetchable.getMappedFetchOptions().getTiming(),
|
||||
false,
|
||||
null,
|
||||
creationState
|
||||
|
|
|
@ -52,7 +52,7 @@ public class ImplicitFetchBuilderPlural implements ImplicitFetchBuilder {
|
|||
final Fetch fetch = parent.generateFetchableFetch(
|
||||
fetchable,
|
||||
fetchPath,
|
||||
FetchTiming.DELAYED,
|
||||
fetchable.getMappedFetchOptions().getTiming(),
|
||||
false,
|
||||
null,
|
||||
creationState
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.hibernate.internal.util.IndexedConsumer;
|
|||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||
import org.hibernate.sql.results.graph.collection.internal.EagerCollectionFetch;
|
||||
import org.hibernate.sql.results.graph.embeddable.EmbeddableResultGraphNode;
|
||||
import org.hibernate.sql.results.graph.entity.internal.AbstractNonJoinedEntityFetch;
|
||||
|
||||
/**
|
||||
* This is essentially a List of Fetch(es), but exposing
|
||||
|
@ -50,7 +51,7 @@ public interface FetchList extends Iterable<Fetch> {
|
|||
|
||||
default boolean hasJoinFetches() {
|
||||
for ( Fetch fetch : this ) {
|
||||
if ( fetch instanceof BasicFetch<?> || fetch.getTiming() == FetchTiming.DELAYED ) {
|
||||
if ( fetch instanceof BasicFetch<?> || fetch instanceof AbstractNonJoinedEntityFetch || fetch.getTiming() == FetchTiming.DELAYED ) {
|
||||
// That's fine
|
||||
}
|
||||
else if ( fetch instanceof EmbeddableResultGraphNode ) {
|
||||
|
|
Loading…
Reference in New Issue