[英]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.