1. Query方式@Query("select s from Store s join fetch s.products where s.user.id = :user_id") 2.@EntityGraph(attributePaths = { "products" }) 3. @NamedEntityGraphs({ @NamedEntityGraph(name="allJoinsButMessages", attributeNodes =…
通过ef查询关联数据后,出现无限循环情况,在实体中将属性加上[Newtonsoft.Json.JsonIgnore] . [IgnoreDataMember] 就ok了. 我是查询后,用json转换,json不识别. public class Category { public int Id { get; set; } public string Name { get; set; } [Newtonsoft.Json.JsonIgnore] [IgnoreDataMember] public…