1
以下JPQL:JPQL:在更新设置为null列
UPDATE SignIn signIn SET signIn.cookieUUID = null WHERE signIn.user.id = :userID
给我下面的错误,因为 “=空” 的:
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 'IS NULL WHERE `B0`.`ID` = 9' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
但它的工作原理,当我设置该字段为空字符串(='')。
那么如何使用JQPL将列设置为null?
这仍然给我非常相同的错误(我也试过之前问);) – AndrewBourgeois
该字段只是注释@Column,这隐含意味着该列是可空的。 – AndrewBourgeois
@AndrewBourgeois:你可以使用参数查询吗?我尝试使用EclipseLink,似乎正在工作。 –