File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -947,6 +947,11 @@ public Fetch resolveCircularFetch(
947
947
final AssociationKey associationKey = foreignKeyDescriptor .getAssociationKey ();
948
948
final boolean associationKeyVisited = creationState .isAssociationKeyVisited ( associationKey );
949
949
if ( associationKeyVisited || bidirectionalAttributePath != null ) {
950
+ if ( !associationKeyVisited && creationState .isRegisteringVisitedAssociationKeys () ) {
951
+ // If the current association key hasn't been visited yet and we are registering keys,
952
+ // then there can't be a circular fetch
953
+ return null ;
954
+ }
950
955
NavigablePath parentNavigablePath = fetchablePath .getParent ();
951
956
assert parentNavigablePath .equals ( fetchParent .getNavigablePath () );
952
957
// The parent navigable path is {fk} if we are creating the domain result for the foreign key for a circular fetch
@@ -1005,12 +1010,6 @@ public class PrimaryKey {
1005
1010
);
1006
1011
}
1007
1012
1008
- if ( !associationKeyVisited && creationState .isRegisteringVisitedAssociationKeys () ) {
1009
- // If the current association key hasn't been visited yet and we are registering keys,
1010
- // then there can't be a circular fetch
1011
- return null ;
1012
- }
1013
-
1014
1013
/*
1015
1014
class Child {
1016
1015
@OneToOne
You can’t perform that action at this time.
0 commit comments