我目前正在将 SpringBoot 2.7 应用程序迁移到 SpringBoot 3。在 SpringData 存储库中使用以下查询:
\n\n@Query("select b from #{#entityName} b where (trunc(b.date) <= trunc(:date))")\nList<T> findByDate(LocalDateTime date);\n\nRun Code Online (Sandbox Code Playgroud)\n虽然这在 SpringBoot 2.7 中效果很好,但在 SpringBoot 3 中会抛出以下消息:
\n\n\norg.hibernate.QueryException:函数 trunc() 的参数 1 的类型为 NUMERIC,但参数的类型为 java.time.LocalDateTime
\n
不幸的是,简单迁移到 datetrunc 并不成功:
\n\n\n错误消息 = ORA-00904: "DATETRUNC": ung\xc3\xbcltige ID
\n
有人有解决方案吗?
\n此致
\n