qq_26262677
qq_26262677
2015-03-02 06:21

spring data jpa 按条件分页查询问题

  • select
  • 代码
  • data
  • 分页
  • jpa

自定义分页查询方法,代码:

 {"content":[],"totalPages":1,"totalElements":6,"last":true,"number":1,"size":10,"numberOfElements":0,"sort":null,"first":false} 

totalElements 是6 但是content怎么是空的啊

 @Query("select t from TrainTeacher t where t.xm like %:xm%")
    Page<TrainTeacher> search(@Param("xm") String xm, Pageable pageable);

返回结果

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐