mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-09 04:34:49 +00:00
HHH-16191 Fix eager associations not fetched with native queries
This commit is contained in:
parent
058afd409a
commit
88a5fd4d28
@ -130,7 +130,7 @@ public Fetch buildFetch(
|
||||
final Fetch fetch = parent.generateFetchableFetch(
|
||||
fetchable,
|
||||
fetchPath,
|
||||
FetchTiming.DELAYED,
|
||||
fetchable.getMappedFetchOptions().getTiming(),
|
||||
false,
|
||||
null,
|
||||
creationState
|
||||
|
@ -52,7 +52,7 @@ public Fetch buildFetch(
|
||||
final Fetch fetch = parent.generateFetchableFetch(
|
||||
fetchable,
|
||||
fetchPath,
|
||||
FetchTiming.DELAYED,
|
||||
fetchable.getMappedFetchOptions().getTiming(),
|
||||
false,
|
||||
null,
|
||||
creationState
|
||||
|
@ -16,6 +16,7 @@
|
||||
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 @@ default Stream<Fetch> stream() {
|
||||
|
||||
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…
x
Reference in New Issue
Block a user