An Entity A with a map collection having as index an Embeddable with a an association to the Entity A fails with a NPE

Description

The following model
```
@Entity
public class TheOne {
@Id
private String id;
@OneToMany(mappedBy = "theMapKey.theOne")
@MapKey(name = "theMapKey")
private Map<TheMapKey, TheMany> theManys = new HashMap<>();
}

@Embeddable
public class TheMapKey implements Serializable {
@ManyToOne
private TheOne theOne;
}

@Entity
public static class TheMany {
@EmbeddedId
private TheMapKey theMapKey;
}
```
causes a
```
java.lang.NullPointerException
at org.hibernate.loader.plan.build.internal.AbstractLoadPlanBuildingAssociationVisitationStrategy.foundCircularAssociation(AbstractLoadPlanBuildingAssociationVisitationStrategy.java:669)
```

Environment

None

Assignee

Andrea Boriero

Reporter

Andrea Boriero

Fix versions

None

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.2.21

Affects versions

Priority

Major
Configure