title: Hibernate ClassCastException IdentNode cannot cast to DotNode
body: <p>I am sitting with a ClassCastException while executing simple update query using JPQL.</p>
  
  <p>Below is the exception trace:</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: org.hibernate.hql.internal.ast.tree.IdentNode cannot be cast to org.hibernate.hql.internal.ast.tree.DotNode
  at org.hibernate.hql.internal.ast.tree.AssignmentSpecification.&lt;init&gt;(AssignmentSpecification.java:71) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.ast.HqlSqlWalker.evaluateAssignment(HqlSqlWalker.java:1133) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.ast.HqlSqlWalker.evaluateAssignment(HqlSqlWalker.java:1127) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.assignment(HqlSqlBaseWalker.java:1042) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.setClause(HqlSqlBaseWalker.java:747) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.updateStatement(HqlSqlBaseWalker.java:367) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:255) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:248) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:105) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:80) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:168) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:221) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:199) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1777) [hibernate-core-4.2.0.SP1.jar:4.2.0.SP1]
  at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:291) [hibernate-entitymanager-4.2.0.SP1.jar:4.2.0.SP1]
  at org.jboss.as.jpa.container.AbstractEntityManager.createQuery(AbstractEntityManager.java:425) [jboss-as-jpa-7.2.1.Final-redhat.jar:7.2.1.Final-redhat]
  </code></pre>
  
  <p>The query, I am executing is to move the task from the workpool:</p>
  
  <pre><code>public Boolean changeWorkpool(final TaskWorkpoolChangeRequest taskWorkpoolChangeRequest) {
      final Query query = entityManager.createQuery("UPDATE Task SET workpoolId = :workpoolId"
          + " WHERE taskId= :taskId");
      query.setParameter("workpoolId", taskWorkpoolChangeRequest.getWorkpoolId())
          .setParameter("taskId", taskWorkpoolChangeRequest.getTaskId());
      return BooleanUtils.toBoolean(query.executeUpdate());
  }
  </code></pre>
  
  <p>Can someone please shed some on the cause of this exception.</p>
  
  <p>Thanks in advance.</p>