Querydsl 限制记录示例 [英] Querydsl limit record example

查看:59
本文介绍了Querydsl 限制记录示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过querydsl选择限制记录,我的查询是这样的:

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?

推荐答案

使用 QueryDslPredicateExecutor.findAll(Predicate predicate, Pageable pageable) 然后使用 PageRequest.of(0,限制).

这篇关于Querydsl 限制记录示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆