小编use*_*743的帖子

spring data rest update产生交叉连接sql错误

我想使用spring data rest更新某些用户的行,但在运行时,此查询会在查询中添加奇怪的"交叉连接".

弹簧数据休息方法

 @Modifying
@Transactional
@Query("Update Notification n SET n.noticed = true Where n.notificationPost.owner.userId = 1 ")
public void postNoticed();
Run Code Online (Sandbox Code Playgroud)

运行时创建的查询

Hibernate: update notification cross join  set noticed=true where owner_id=?
Run Code Online (Sandbox Code Playgroud)

我唯一关心的是为什么添加"交叉连接",因为它给出了sql错误

org.postgresql.util.PSQLException: ERROR: syntax error at or near "cross"
Run Code Online (Sandbox Code Playgroud)

我通过rest调用直接调用这个方法,并且从mvc控制器调用这两种方法产生相同的错误

提前致谢.

spring-data spring-data-rest

4
推荐指数
1
解决办法
1578
查看次数

标签 统计

spring-data ×1

spring-data-rest ×1