我对此查询有疑问:
@Modifying
@Query("UPDATE NotificationHasUser u SET u.read=true WHERE u.pk.user = ?1")
void setNotificationsAsRead(User user);
我想更新所有false read
值(因为我必须将未读通知切换为读取)以获取特定用户名。
我甚至试过1而不是真的,但我总是收到这个例外:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read=1 where id_username='luca'' at line 1
你对这个问题有所了解吗?