问题
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