title: How to make the HQL update query with additional operation
body: <p>I need to sum amounts using an update HQL query, but I can not find right way. Hibernate gave me:</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: node to traverse cannot be null</p>
  </blockquote>
  
  <p>Here's my code:</p>
  
  <pre><code> String upd = "update Clients client set client.balance=client.balance + ? " +
     "where client.idClient = " + ob.getIdClient();
  Query qry = session.createQuery(upd);
  qry.setInteger(0, ob.getBalance());
  int res = qry.executeUpdate();
  </code></pre>
  
  <blockquote>
    <p>2016-05-18 17:08:27,183 ERROR - line 1:8: unexpected token: by
    2016-05-18 17:08:27,213 ERROR - line 1:8: unexpected token: by
    line 1:8: unexpected token: by
        at org.hibernate.hql.internal.antlr.HqlBaseParser.updateStatement(HqlBaseParser.java:239)
        at org.hibernate.hql.internal.antlr.HqlBaseParser.statement(HqlBaseParser.java:169)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:295)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:203)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158)
        at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:131)
        at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:93)
        at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:167)
        at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301)
        at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236)
        at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1836)
        at by.telnet.dao.DaoClients.updateBalance(DaoClients.java:30)
        at by.telnet.services.command.ClientCommand.updateBalance(ClientCommand.java:111)
        at by.telnet.command.Command.pay(Command.java:140)
        at by.telnet.controllers.MainServlet.switcher(MainServlet.java:82)
        at by.telnet.controllers.MainServlet.doPost(MainServlet.java:24)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)</p>
  </blockquote>