为什么这是工作:
@Query("from Ban b where b.banned.uuid = :uuid")
但这会导致SQL语法错误:
@Query("delete Ban b where b.banned.uuid = :uuid")
错误消息为: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 'cross join user user1_ where uuid=x'53......'' at line 1
1条答案
按热度按时间lyfkaqu11#
HQL和SQL通常(至少据我所知)都不支持
delete
语句中的连接,但是,您可以使用子查询模拟它,如下所示: