title: How to update a List of entities in Hibernate
body: <p>I have a list of objects I'm trying to update in the database. I can update one of them like so</p>
  
  <pre><code>MyObj entity = getObjectFromDb();
  entity.changeSomething();
  getHibernateTemplate().update(entity);
  </code></pre>
  
  <p>What if I have a List of objects? Is it possible to do this without iterating through the list of objects and updating them one by one? That doesn't sound efficient to me. So I need something like this</p>
  
  <pre><code>List&lt;MyObj&gt; entities = getObjectsFromDb();
  //change some attribute of the entities
  getHibernateTemplate().update(entities); //this doesn't work because entities is a List
  </code></pre>