
在Hibernate文档说:
批量HQL查询中不能指定隐式或显式连接。子查询可以在where子句中使用,其中子查询本身可能包含联接。
lt.trade.volume是LocationTrade和Trade之间的隐式内部联接,因此该查询无效。您必须将其重写为以下内容:
update LocationTrade lt set lt.hasVeryHighVolume=true where lt.locationIndices=? and lt.id in ( select lt2.id from LocationTrade lt2 where lt2.trade.volume > 20000)
否则,您将不得不使用SQL查询。