这是我的查询:
update JSNumber set runningNo=(select runningNo +1 from JSNumber where paymentDate= '2015-07-09 00:00:00.0' ) where paymentDate = '2015-07-09 00:00:00.0'
当我将它设置为StringBuilder
sb 时,这工作正常,并按如下方式运行:
Query query = getSession( ).createQuery( sb.toString( ) );
这是我编辑的查询:
select runningNo from final table (update JSNumber set runningNo=(select runningNo +1 from JSNumber where paymentDate= '2015-07-09 00:00:00.0' ) where paymentDate = '2015-07-09 00:00:00.0' )
我在select runningNo from final table ()
原始查询前面添加。当我运行它时它工作正常DBVisualizer
,但是当我想以 hql 运行时,我点击了
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ( near line 1, column 35
请建议如何在 hql 查询中编写它。