title: room db update multiple rows with @query
body: <p>I would like to update multiple rows in a room database. But I don't have the objects - I have only the ids.</p>
  
  <p>If I update one row I write something like this to my DAO:</p>
  
  <pre><code>@Query("UPDATE items SET place = :new_place WHERE id = :id;")
  fun updateItemPlace(id:Int, new_place:String)
  </code></pre>
  
  <p>With multiple rows I would need something like this:</p>
  
  <pre><code>@Query("UPDATE items SET place = :new_place WHERE id = :ids;")
  fun updateItemPlaces(ids:List&lt;Int&gt;, new_place:String)
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>@Query("UPDATE items SET place = :new_place WHERE id IN :ids;")
  fun updateItemPlaces(ids:String, new_place:String)
  </code></pre>
  
  <p>where I write something like '(1,4,7,15)' to my ids-String</p>
  
  <p>Can someone tell me a good way to make such an update</p>
  
  <p>because something like</p>
  
  <pre><code>val ids = ListOf(1,4,7,15)
  ids.forEach{
      itemDao.updateItemPlace(it,'new place')
  }
  </code></pre>
  
  <p>does not seem to be a good solution</p>