I was wondering what is the standard practice for pagination in case someone is not using an ORM
?
Use of eg limit
as part of the SQL query?
Also is this problem solved by an ORM out of the box?
Yes, the standard practice is to limit the results using some limit clause (which is, unfortunately, non-standard and different for every database).
JPA supports that natively using the setFirstResult()
and setMaxResults()
methods, which are translated to the appropriate limit clause in SQL.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.