我希望使用Spring Data Rest来更新特定用户的行,但在运行时,这个查询会添加奇怪的“交叉连接”到查询中。
Spring Data Rest方法
@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=?
我唯一的担忧是为什么加入了“cross join”会导致SQL错误
org.postgresql.util.PSQLException: ERROR: syntax error at or near "cross"
我直接通过REST调用以及从MVC控制器中调用这种方法,但两种方式都产生了相同的错误。
提前感谢。