title: Android with Room - How to set a foreign key nullable
body: <p>I'm using Room in my Android app. One table (stock_move) contains several Foreign keys. In some case, I need to insert a stock_move without a FK (locationDestId). In this case, SQLite raise an error:</p>
  
  <blockquote>
    <p>io.reactivex.exceptions.OnErrorNotImplementedException: foreign key constraint failed (code 19)</p>
  </blockquote>
  
  <p>There is my entity:</p>
  
  <pre><code>@Entity(tableName = "stock_move",
      foreignKeys = {
              @ForeignKey(
                      entity = LocationEntity.class,
                      parentColumns = "id",
                      childColumns = "location_id",
                      onDelete = CASCADE
  
              ),
              @ForeignKey(
                      entity = LocationEntity.class,
                      parentColumns = "id",
                      childColumns = "location_dest_id",
                      onDelete = CASCADE
              ),
              @ForeignKey(
                      entity = ProductEntity.class,
                      parentColumns = "id",
                      childColumns = "product_id",
                      onDelete = CASCADE
              ),
              @ForeignKey(
                      entity = UomEntity.class,
                      parentColumns = "id",
                      childColumns = "uom_id",
                      onDelete = CASCADE
              )
      }
  )
  public class StockMoveEntity {
      @PrimaryKey(autoGenerate = true)
      private int id;
  
      private String name;
  
      @ColumnInfo(name="product_id")
      private int mProductId;
  
      @ColumnInfo(name="uom_id")
      private int mUomId;
  
      @ColumnInfo(name="location_id")
      private int mLocationId;
  
      @ColumnInfo(name="location_dest_id")
      private int mLocationDestId;
  
      private int mProductQty;
  
      public StockMoveEntity(int id, String name, int productId, int uomId, int locationId, int locationDestId, int productQty) {
          this.id = id;
          this.name = name;
          mProductId = productId;
          mUomId = uomId;
          mLocationId = locationId;
          mLocationDestId = locationDestId;
          mProductQty = productQty;
      }
  }
  </code></pre>