我想在我的ORDER BY子句中使用表达式。这在SpringDataJPA中是可能的吗?Spring提供了_org.springframework.data.domain.Sort.Sor_t来处理排序,但它不包含任何按情况处理订单的函数。我希望实现与以下JPA语句相当的功能,但使用Spring:
ORDER BY CASE
我正在尝试使用带有方法名称解析的springdataJPA来实现以下查询。select count(*) from example ex where ex.id = id and ex.status in (1, 2);
我知道在crud repo中有一个用于计数的方法,它将类似于- countByIdAndStatus(params),但我不确定如何将" in“子句合并到此方法中。
在java spring引导应用程序上工作。我们的postgres数据库是集装箱化的。我可以让hibernate自动创建表,但无法让它自动运行import.sql文件。你能帮我弄清楚是怎么回事吗?: Make sure this isn't pulled in in the production jar
implementation('org.springframework.boot:spring-boot-starter-data-jpa/post