I am using ManyToOne , OneToMany and have endless loop when getting data
问题 I am using ManyToOne and OneToMany in hibernate .I want to create a user who has locations. When I get data in postman I have endless loop because when I get user it's showing a user's location and in location showing user and so on. Here is code: Locations class : @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL) @JoinColumn(name=FLD_LOC, nullable=false) private Consumer consumers; public Consumption(String location, float consumpiton,Consumer consumer) { this.location = location;