title: I am trying following query and getting unexpected token : in exception
body: <pre><code>public boolean insert(Product product){       
          boolean result = true;
          Transaction tx = null; 
          int quantity=0;
          try {
              tx = session.getTransaction();
              tx.begin();
  
              Query query=session.createQuery("update Stock s set s.quantity=s.quantity+100");
              query.executeUpdate();
              session.saveOrUpdate(product); 
  
              tx.commit();
          } catch (Exception e) {
              if (tx != null) {
                  tx.rollback();
              }
              result=false;
          } finally {
              session.close();
          }        
          return result;
  }
  </code></pre>
  
  <p>select ,save and delete query are working successfully but This exception I am getting only in while update the record.... </p>
  
  <p>I want to save the record in Product Table and as well as update Stock Table</p>
  
  <p><strong>BELOW IS MY EXCEPTION</strong></p>
  
  <pre><code>org.hibernate.hql.internal.ast.ErrorCounter reportError
  ERROR: line 1:8: unexpected token: in
  Sep 12, 2015 10:34:41 AM org.hibernate.hql.internal.ast.ErrorCounter reportError
  ERROR: line 1:8: unexpected token: in
  line 1:8: unexpected token: in
      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.&lt;init&gt;(HQLQueryPlan.java:131)
      at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(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 in.edu.pondiuni.service.ProductService.insert(ProductService.java:23)
      at in.edu.pondiuni.controller.ProductServlet.processRequest(ProductServlet.java:53)
      at in.edu.pondiuni.controller.ProductServlet.doGet(ProductServlet.java:91)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  </code></pre>