Answer the question
In order to leave comments, you need to log in
Looping on @onetomany?
Good evening. There are two entities, store and bonus. And a one-to-many relationship. T e store has a lot of bonuses. Requires bi-directional communication. That is, one url gives an array of bonuses (each bonus object contains a store object), and another url gives an array of stores (each store contains an array of bonuses). The problem is looping.
For the bonus, I set @JsonBackReference, and for the store, respectively, @JsonManagedReference.
The looping is gone, when the list of stores is displayed, their bonuses are also displayed, and when the list of bonuses is displayed, the stores are not displayed.
The question is how to implement the withdrawal of stores?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question