从 table 中检索最后 100 条记录

Retrieve the last 100 record from table

我在数据库中有 table 包含 10000 条记录,我想检索我使用的最后 100 条记录 spring mvc 和 jpa 存储库 谁能帮我怎么做?

您可以这样做:

 String hql="from <your table> order by id desc"
 Query.setMaxResults(100)