title: Room database with one-to-one relation
body: <p>I have 2 Entities, Coin and CoinRevenue.</p>
  
  <p>Basically, coin holds the price in USD for some other currency.</p>
  
  <p>For example, Coin with symbol EUR with value of 1.0356</p>
  
  <pre><code>@Entity(tableName = "coin")
  data class Coin(
          @field:PrimaryKey(autoGenerate = false)
          var id: String = "",
          var symbol: String = "",
          var pricInUsd: Float = 0f)
  </code></pre>
  
  <p>CoinRevenue is an Entity that I use to hold how much coins of that specific coins the User have.
  For example, CoinRevenue has relation to Coin Entity with EUR symbol and amount of 1000.</p>
  
  <pre><code>@Entity(tableName = "coinRevenue")
      data class CoinRevenueNew(
              @field:PrimaryKey(autoGenerate = true)
              var id: Int = 0,
              var coin: Coin? = null,
              var amount: Float = 0f)
  </code></pre>
  
  <p>Now I want to fetch CoinRevenue from the database and get the updated Coin from the database.</p>
  
  <p>for example, i saved the Coin with (EUR,1.0253)
  and than Saved a CoinRevenue with that coin.</p>
  
  <p>After that I updated the Coin with (EUR,2.522)
  I want that the Coin object inside CoinRevenue will be updated as well.</p>
  
  <p>I understand that @Embedded just add the inner objet fields as colums to the same parent object.
  and when I use relation, I have to use a List or a Set.
  but I always have 1 Coin inside CoinRevenue.</p>
  
  <p>My coinDAO:</p>
  
  <pre><code>@Query("select * from coin order by rank")
  fun getAllCoins(): Flowable&lt;List&lt;CoinDB&gt;&gt;
  
  @Query("select * from coin where rank = 1")
  fun getFirstCoin(): Maybe&lt;CoinDB&gt;
  
  @Query("select * from coin where favourite = 1 order by rank")
  fun getAllFavouriteCoins(): Flowable&lt;List&lt;CoinDB&gt;&gt;
  
  @Insert(onConflict = OnConflictStrategy.REPLACE)
  fun insertCoin(coinDB: CoinDB)
  
  @Insert(onConflict = OnConflictStrategy.REPLACE)
  fun insertCoins(coinsList: List&lt;CoinDB&gt;)
  
  // -----------------
  // CoinRevenue
  // -----------------
  
  @Query("select * from coinRevenue order by rank")
  fun getAllCoinsRevenue(): Flowable&lt;List&lt;CoinRevenue&gt;&gt;
  
  @Insert(onConflict = OnConflictStrategy.REPLACE)
  fun insertCoinRevenue(coinRevenue: CoinRevenue)
  
  @Delete()
  fun deleteCoinRevenue(coinRevenue: CoinRevenue)
  </code></pre>
  
  <p>What is the best way to creat this?</p>