获取 "error":“<expression>、<operator>、GROUP、HAVING 或 ORDER 预期得到 '('”
Getting "error": "<expression>,<operator>, GROUP, HAVING or ORDER expected got '('"
IntelliJ IDEA Ultimate 向我显示错误:
<expression>,<operator>, GROUP, HAVING or ORDER expected got '('
就在 HQL 语句内的 braket 下,这显然不是编译或运行时的问题。
@Query("SELECT offer FROM OfferEntity offer " +
" JOIN offer.placeOwnership AS owner " +
" JOIN owner.place AS place " +
"WHERE " +
" place.id = :placeId AND " +
" to_char(offer.dayFrom, 'yyyy-MM-dd') = :offerDate AND " +
^
<expression>,<operator>, GROUP, HAVING or ORDER expected got '('
" offer.repeating = false")
List<OfferEntity> getAllForDate(@Param("placeId") Long placeId, @Param("offerDate") String offerDate);
知道为什么会这样以及如何摆脱这种情况吗?这很烦人且具有误导性(大概是因为代码正在运行)。
https://www.baeldung.com/spring-data-jpa-query -> 在 2.2 Native
@Query(
value = "SELECT * FROM USERS u WHERE u.status = 1",
nativeQuery = true)
为我们工作。您需要添加“值=”和“,
@Query
中的 nativeQuery = true"
IntelliJ IDEA Ultimate 向我显示错误:
<expression>,<operator>, GROUP, HAVING or ORDER expected got '('
就在 HQL 语句内的 braket 下,这显然不是编译或运行时的问题。
@Query("SELECT offer FROM OfferEntity offer " +
" JOIN offer.placeOwnership AS owner " +
" JOIN owner.place AS place " +
"WHERE " +
" place.id = :placeId AND " +
" to_char(offer.dayFrom, 'yyyy-MM-dd') = :offerDate AND " +
^
<expression>,<operator>, GROUP, HAVING or ORDER expected got '('
" offer.repeating = false")
List<OfferEntity> getAllForDate(@Param("placeId") Long placeId, @Param("offerDate") String offerDate);
知道为什么会这样以及如何摆脱这种情况吗?这很烦人且具有误导性(大概是因为代码正在运行)。
https://www.baeldung.com/spring-data-jpa-query -> 在 2.2 Native
@Query(
value = "SELECT * FROM USERS u WHERE u.status = 1",
nativeQuery = true)
为我们工作。您需要添加“值=”和“, @Query
中的 nativeQuery = true"