According the entity-relationship model, the relationship between tbl_post and tbl_category could be specified using Room Persistency Libr
In Kotlin:
@Entity(
tableName = "some_table",
indices = [Index("id"), Index("brand_id"), Index("model_id")],
foreignKeys = [
ForeignKey(entity = BrandEntity::class, parentColumns = ["id"],
childColumns = ["brand_id"]),
ForeignKey(entity = ModelEntity::class, parentColumns = ["id"],
childColumns = ["model_id"]),
ForeignKey(entity = Table1Entity::class, parentColumns = ["id"],
childColumns = ["table1_id"]),
ForeignKey(entity = Table2Entity::class, parentColumns = ["id"],
childColumns = ["table2_id"])
]
)