nutz icon indicating copy to clipboard operation
nutz copied to clipboard

请问Nutz中Dao如何使用多级的自关联查询

Open defaultw opened this issue 1 year ago • 1 comments

现在数据结构如下: |- 层级1 |- 层级2 |- 层级3 ”层级“作为对象,pojo里有属性 @Many(field = "pId")List<层级> children;以及父层级String pId;具体又多少层嵌套不确定。 现在使用 dao.fetchLinks(dao.fetch(this.query(层级.class, Cnd.where("pId", "=", "xxxx")), "children"); 只能查到两层,第三层之外为null。

defaultw avatar Aug 09 '22 05:08 defaultw

|- 层级1
   |- 层级2
      |- 层级3

defaultw avatar Aug 09 '22 05:08 defaultw

并不支持

wendal avatar Aug 18 '22 16:08 wendal

只能逐层fetchLinks

wendal avatar Aug 18 '22 16:08 wendal