Roomはオブジェクトでのリレーションができなくて、1対多を実現するのに少し手こずったのでメモを残しておきます。 例として、UserとPetというの使って、Userは複数のPetを持つことをできるというのを実現してみます。 Entityまずは2つのEntityの定義です。 Userはシンプルな感じです。 @Entity(tableName = "user") data class User( @PrimaryKey var id: Int, var name: String )次にPetです。foreignKeysのとこが色々設定してます。 @Entity(tableName = "pet", foreignKeys = arrayOf(ForeignKey( entity = User::class, parentColumns = arrayOf("id"), childColumns

