title: Android two way data binding with room table models
body: <p>So I have room model classes annotated with @Entity annotation which contain fields annotated with @ColumnInfo.</p>
  
  <p>I also have a view that binds to the object of this model:</p>
  
  <pre><code>   &lt;EditText
          android:id="@+id/sadfadsdfasd"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:gravity="center"
          android:hint="@string/assdsa"
          android:inputType="text"
          android:text="@={fuelPrice.modification}" /&gt;
  </code></pre>
  
  <p>Like this it works when displaying EditText. It shows value from my model, but when I modify EditText, that modification is not being stored in my object even though I use @= signs which indicate two way binding.</p>
  
  <p>So if I understand correctly, I can't really use POJO with simple primitive fields for two way data binding and instead I should have all fields as observables of required type or fields wrapped in LiveData?</p>
  
  <p>If above case is true, does that mean that to have two way binding for room entities, I have to create separate class for each entity which would implement all the observable fields and update my entity object accordingly? Or is there a simplier solution?</p>
  
  <p><strong>EDIT</strong>
  Above case was false. Seems like two way binding does work for simple POJO classes with appropriate getters and setters.</p>