我目前正在使用Spring JPA,并按照此处所述利用排序和分页功能-
How to query data via Spring data JPA by sort and pageable both out of box?
现在,我的问题是如何将“where”子句应用于此?
例如。
where PRODUCT_NAME='abc';
最佳答案
只需在您的存储库界面中为此创建一个查询方法。
看一下文档here。
使用分页和where子句添加查询方法。
Page<User> findByLastname(String lastname, Pageable pageable);
因此,您可以通过属性“姓氏”找到“用户”并配置“分页”设置。
关于java - Spring Data JPA应用排序,分页以及where子句,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14120153/