title: How can I execute an update (named query) in Hibernate Template?
body: <p>I have a namedQuery like this:</p>
  
  <pre><code>@NamedQueries ({ ...
  
  @NamedQuery(name = "myUpdate", query = "update User set country = 'EN' where user.id = :id")
  </code></pre>
  
  <p>...
  })</p>
  
  <p>In dao layer </p>
  
  <pre><code>getHibernateTemplate().bulkUpdate(...?)
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>Query query = sessionFactory.getCurrentSession.getNamedQuery("myUpdate");
  getHibernateTemplate.bulkUpdate(query.getQueryString(), id);
  </code></pre>
  
  <p>I get an error:</p>
  
  <p>Hibernate: update User, set country=EN where id = 2343 ORA-00971: missing SET keyword</p>
  
  <p>Anybody now how can resolve this problem?</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <pre><code>@NamedQuery(name = "myUpdate", query =
   "update User set country = 'EN' where
   user.profile.id = ?")
  </code></pre>
  
  <p>OK</p>
  
  <pre><code>  @NamedQuery(name = "myUpdate", query =
       "update User set country = 'EN' where
       user.profile.name = ?")
  </code></pre>
  
  <p>NOT OK :(</p>