这是一个代码示例,可以获取知道父级的子级实体。请注意,此查询将返回分页的Child结果。
@Query("select child from Parent p inner join p.childs child where p = :parent") public Page<Child> findBy(@Param("parent") Parent parent, Pageable pageable);您可以像这样使用它:
Page<Child> findBy = repo.findBy(parent, new PageRequest(page, size));



