【问题标题】:How to get n elements of list in Jpa repository?如何在 Jpa 存储库中获取列表的 n 个元素?
【发布时间】:2021-11-26 10:31:13
【问题描述】:

我可以得到 findTop4ByOrderByIdDescInvesteeId(LonginvesteeId) 吗?

列出 findTop4ByOrderByIdDescInvesteeId(LonginvesteeId);这不起作用

【问题讨论】:

    标签: spring spring-boot spring-mvc jpa spring-data-jpa


    【解决方案1】:

    您的语法错误,orderByDesc 应该在最后。

    而且first By后面应该有参数

    试试findTop4ByIdOrderByIdDesc

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-24
      • 1970-01-01
      • 2013-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多