I suspect you might have exported = false on your PersonEntity object. Because of this, any links in PersonEntity will be added to the _links section of your TeamEntity . Since both PersonEntity have a createdBy link, they come across a TeamEntity.createdBy link.
To understand what is going on, this example may help:
class Answer { Question q;
In my case, since Answer can only exist inside Question , our AnswerResource has the following: to prevent export of answers:
@RestResource(exported = false)
This results in the serialization of Answer objects in the parent object, and not as a link in the _links section, and this ultimately causes the problem ....
When UserAnswer serialized, it displays something like the following:
{ "answer" : { "creationDate" : "2014-09-18T17:28:31.000+0000", "modificationDate" : "2014-09-18T17:28:31.000+0000", "answerText" : "Vendas", }, "_links" : { "self" : { "href" : "http://localhost:9090/data/userAnswers/15" }, "question" : { "href" : "http://localhost:9090/data/userAnswers/15/question" } } }
Note that the "_links.question" above is in Answer !
So, if you add Question to UserAnswer , you will see the error you are asking about, because UserAnswer also wants to include the _link link in Question .
In your case, I think your PersonEntity and your TeamEntity both have createdBy links.
I am not 100% sure what the solution is, I donβt know if you can specify the hierarchical names rel .