gpt4 book ai didi

java - CRUD-Repository OrderBy 不需要参数

转载 作者:行者123 更新时间:2023-12-01 19:41:46 26 4
gpt4 key购买 nike

我在 CRUD-Repository 中定义了此方法:

List<MenuPriceByDay> findAllOrderByUpdateDate();

但是当我启动应用程序时。我收到此错误:

Failed to create query for method public abstract java.util.List com.tdk.backend.persistence.repositories.MenuPriceByDayRepository.findAllOrderByUpdateDate()! No parameter available for part updateDate SIMPLE_PROPERTY (1): [Is, Equals] NEVER.

最佳答案

请检查一下这个spring jpa documentation ?

一定是这样的

// Enabling static ORDER BY for a query
List<Person> findByLastnameOrderByFirstnameAsc(String lastname);
List<Person> findByLastnameOrderByFirstnameDesc(String lastname);

You can apply static ordering by appending an OrderBy clause to the query method that references a property and by providing a sorting direction (Asc or Desc).

关于java - CRUD-Repository OrderBy 不需要参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55167885/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com