Suppose we have the following entities:
When the above entities are added to the annotated classes list in the order
then the exception is thrown when the mappings are processed:
However, when the order is
everything works ok.
Also, if the Friendship mapping is changed by adding explicit referencedColumnName to the requester and friend fields, everything works ok regardless of the order in which the entities are added to the annotated classes list: