title: HQL multiple updates. Is there a better way?
body: <p>I have a Map, that I want to persist. The domain object is something like this:</p>
  
  <pre><code>public class Settings {
      private String key;
      private String value;
  
      public String getKey() { ... }
      public String getValue() { ... }
      public void setKey(String key) { ... }
      public void setValue(String value) { ... }
  }
  </code></pre>
  
  <p>The standard approach is to generate a <code>Setting</code> for each pair, and <code>saveOrUpdate()</code> it. But it generates way too much queries, because I need to save lots of settings at a time, and it really affects perfomance. Is there a way to do this using one update query?</p>
  
  <p><strong>UPD:</strong> Okay, maybe there is a hql syntax for updating multiple rows? Something like</p>
  
  <pre><code>update Settings s1 set s1.value = :value1 where s1.key = :key1
                  s2 set s2.value = :value2 where s2.key = :key2
  </code></pre>