I use @JsonIgnoreAnnotation to prevent endless loops when creating Json for answers, and it works fine for what I need, but I would like to know if there is some alternative where the property is not actually ignored but also prevents the endless loop.
For example, I have entityA with the following properties:
int id
String name
EntityB example;
and entityB has
int id
String something
EntityA entityAExample
So, if I get all the registers in entityA, the answer will look like this:
[{
"id":"1",
"name": "name",
"entityB": {
"id":"1",
"something": "text"
}
}]
And entityB would look like this:
[{
"id":"1",
"something": "text"
}]
, , , B entityA ( , " " ), :
[{
"id":"1",
"something": "text",
"entityAExample": {
"id":"1",
"name": "name"
}
}]
, , , .