[英]Spring Boot Postgres JPA, not returning the Primary key in response of findAll()
[英]One row repeating multiple times in spring boot Jpa .findall() response restfull api
當我使用 jpaRepository 從包含外鍵 userId 的類別表中從我的數據庫中獲取數據時遇到問題。 oneToMany 的關系,數據幾乎很好,但它會重復多次。 這里有一些圖片: categoryServiceImpl
這可能是由於雙向關系。嘗試在類別 class 中使用@JsonBackReference
@ManyToOne(fetch = FetchType.LAZY,optional= false)
@JsonBackReference
private User users;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.