I have an issue when I fetch data from my database with jpaReposeitory from category table which has a foriegn key userId in it. relationship of oneToMany, data is coming almost fine but it repeats itself multiple times. here are some images: categoryServiceImpl
It may be due to bidirectional relationship.Try using @JsonBackReference in category class
@ManyToOne(fetch = FetchType.LAZY,optional= false)
@JsonBackReference
private User users;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.