title: ROOM how to swap two entity for Drag & Drop in list
body: <p>I am learning how to use ROOM as part of Android Architecture Components. For a regular recyclerviews, I am able to implement <code>onSwipe</code> to delete a post on the list easily and my <code>ViewModel</code> will directly calls my repository to call ROOM to delete the given post. </p>
  
  <p>However, I ran into some issues when I tried to also implement the <code>onMove</code> callbacks. the callback listed as below: </p>
  
  <pre><code>public boolean onMove(@NonNull RecyclerView recyclerView,
                        @NonNull RecyclerView.ViewHolder viewHolder,
                        @NonNull RecyclerView.ViewHolder target) 
  </code></pre>
  
  <p>from here i can get the before and after positions, my naive thinking is that I should be able to <strong>swap</strong> these two post in my Repository and my LiveData will update the list automatically. </p>
  
  <p>But I don't know how to do the operation (<strong>swap</strong>) on <code>DAO</code> and <code>ROOM</code> parts. Can you please share your idea or correct me if I am heading to the wrong direction? </p>