title: HibernateException: Errors in named query
body: <p>When running a particular unit-test, I am getting the exception:</p>
  
  <pre><code>Caused by: org.hibernate.HibernateException: Errors in named queries: UPDATE_NEXT_FIRE_TIME
  at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:437)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
  at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
  at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:891)
  ... 44 more
  </code></pre>
  
  <p>for the named query defined here:</p>
  
  <pre><code>@Entity(name="fireTime")
  @Table(name="qrtz_triggers")
  @NamedQueries({
  @NamedQuery(
          name="UPDATE_NEXT_FIRE_TIME",
          query= "update fireTime t set t.next_fire_time = :epochTime where t.trigger_name = 'CalculationTrigger'")
  })
  public class JpaFireTimeUpdaterImpl implements FireTimeUpdater {
  
  @Id
  @Column(name="next_fire_time", insertable=true, updatable=true)
  private long epochTime;
  
  public JpaFireTimeUpdaterImpl() {}
  
  public JpaFireTimeUpdaterImpl(final long epochTime) {
      this.epochTime = epochTime;
  }
  
  @Override
  public long getEpochTime() {
      return this.epochTime;
  }
  
  public void setEpochTime(final long epochTime) {
      this.epochTime = epochTime;
  }
  
  }
  </code></pre>
  
  <p>After debugging as deep as I could, I've found that the exception occurs in w.statement(hqlAst) in QueryTranslatorImpl:</p>
  
  <pre><code>    private HqlSqlWalker analyze(HqlParser parser, String collectionRole) throws QueryException, RecognitionException {
      HqlSqlWalker w = new HqlSqlWalker( this, factory, parser, tokenReplacements, collectionRole );
      AST hqlAst = parser.getAST();
  
      // Transform the tree.
      w.statement( hqlAst );
  
      if ( AST_LOG.isDebugEnabled() ) {
          ASTPrinter printer = new ASTPrinter( SqlTokenTypes.class );
          AST_LOG.debug( printer.showAsString( w.getAST(), "--- SQL AST ---" ) );
      }
  
      w.getParseErrorHandler().throwQueryException();
  
      return w;
  }
  </code></pre>
  
  <p>Is there something wrong with my query or annotations?</p>