I have a Car entity and a Holder set in it.
@Entity public class Car { // fields @ManyToMany @JoinTable(name = "holder_car", joinColumns = @JoinColumn(name = "car_id"), inverseJoinColumns = @JoinColumn(name = "holder_id")) @NotNull private Set<Holder> holder; Also here is an Entity Holder .
@Entity public class Holder { // fields @ManyToMany(mappedBy = "holder") private Set<Car> cars; When I try to pull the Holder entity through the GET method, the answer goes into an "infinite loop". That is, the answer sends all the fields, and when it comes to the field, cars start issuing the fields of this entity, then reaching the field of holder and displaying its fields. And so on to infinity. It looks like this:
I read that it seems like Lazy-loading can help, but for some reason the answer comes the same. How can this be fixed?
