I would like to know the difference between @JsonManagedReference
and @JsonBackReference
in Jackson?
Use case: You have a one-many or many-many relationships in your entities/tables and not using the above would lead to errors like
Infinite Recursion and hence stackoverflow - > Could not write content: Infinite recursion (StackOverflowError)
The above errors occurs because Jackson (or someother similiar) tries to serialise both ends of the relationship and ends up in a recursion.
@JsonIgnore performs similiar functions but the above mentioned annotations are preferable.