我想用spring data rest來更新某些用戶的行,但是在運行時這個查詢有奇怪的「交叉連接」添加到查詢中。創建spring data rest update產生交叉連接sql錯誤
春天數據休息方法
@Modifying
@Transactional
@Query("Update Notification n SET n.noticed = true Where n.notificationPost.owner.userId = 1 ")
public void postNoticed();
運行時間查詢
Hibernate: update notification cross join set noticed=true where owner_id=?
我唯一擔心的就是 「交叉連接」 添加爲它提供了SQL錯誤
org.postgresql.util.PSQLException: ERROR: syntax error at or near "cross"
我打電話此方法直接由rest invoke調用,並且也來自mvc控制器,兩種方式產生相同的錯誤
在此先感謝。
我們看一些實體的代碼片段 – Blank