在控制台中运行HQL查询

时间:2018-10-09 16:47:21

标签: intellij-idea hql

我正在尝试在IntelliJ中运行以下查询:

@Query(value = "" +
        "SELECT offer FROM OfferEntity offer " +
        "   JOIN offer.placeOwnership AS owner " +
        "   JOIN owner.place AS place " +
        "WHERE " +
        "   place.id = :placeId AND " +
        "   offer.dayFrom = :offerDate AND " +
        "   offer.repeating = false")

在执行此操作时,我被要求提供参数placeIdofferDate。我的问题是我对后者一无所知。

enter image description here

我不知道如何运行此查询。


我也试图像这样在控制台内手动运行它:

SELECT offer FROM OfferEntity offer 
   JOIN offer.placeOwnership AS owner 
   JOIN owner.place AS place 
WHERE 
   place.id = 1L AND 
   offer.dayFrom = java.time.LocalDate.parse("2018-10-08") AND 
   offer.repeating = false

但是这给了我一个语法错误。

0 个答案:

没有答案