Querydsl limit record example

帅比萌擦擦* 提交于 2019-12-23 16:27:21

问题


I need to select limit record by querydsl, my query is like:

select *from <table> where <column_id> = 5 limit 2

How can I do a query in my repository interface method to the given above query?


回答1:


Use QueryDslPredicateExecutor.findAll(Predicate predicate, Pageable pageable) and then get the actual results back using PageRequest.of(0, limit).



来源:https://stackoverflow.com/questions/37393485/querydsl-limit-record-example

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!