title: How to modify column value? (JPA)
body: <p>I need to change the value of a column using JPA query syntax(JPQL), how can i do it?</p>
  
  <p>This is how i retrieve the row that i want to update:</p>
  
  <pre><code>@PersistenceContext
      private EntityManager em;
  
      public Role activateUser(long id) {
          Query query = em
                  .createQuery("SELECT r.id FROM Role r WHERE r.id=" + id);
          Role tmpRole = (Role) query.getSingleResult();
          tmpRole.setAccountStatus(AccountStattus.ACTIVATED.toString());
          //How can i create query to save the changes here?)
          return tmpRole;
      }
  </code></pre>
  
  <p>Is there any other alternative to modify that row without retrieving it first? </p>
  
  <p>What do you think is the best approach from the point of view of performance?</p>