【发布时间】:2015-01-06 09:43:56
【问题描述】:
这里的语法有什么问题:
@Modifying
@Query(nativeQuery = true, value = "delete from simple_token where simple_token.expiry < NOW()")
int deleteExpiredTokens();
我得到了异常
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 's where s.expiry < now()' at line 1
但“按原样”执行的查询将在 MYSQL 客户端中正常执行。
我在这里做错了什么?
【问题讨论】:
标签: java mysql spring-data