I have a small query, I have been confused on how to insert an object into a different entity.
I tried a work around doing:

```
@Query("INSERT INTO card_table VALUES(:id, :pid, :question, :answer, :type, :completed)")
    suspend fun insertCard(id: UUID, pid: UUID, question: String, answer: String, type: CardType, completed: Boolean)

```

However, this has not worked.

My question is, how do I insert an object into different entity tables with a single database.

Note -> The insert() query works for inserting decks into the deck\_table. The issue correlates to the card\_table as I am unsure on how to reference it.

Thanks

database

```

    @Insert(onConflict = OnConflictStrategy.ABORT)
    suspend fun insert(deck: Deck)

    @Insert
    suspend fun insertCard(card: FlashCard)

@Database(entities = [Deck::class, FlashCard::class], version = 8, exportSchema = false)
@TypeConverters(DeckTypeConverters::class)
abstract class FlashCardDB : RoomDatabase() {

    abstract fun DeckDAO(): DeckDAO

    companion object {
        private var INSTANCE: FlashCardDB? = null

        fun getDatabase(context: Context, scope: CoroutineScope): FlashCardDB {
            val tmpInstance = INSTANCE

            if (tmpInstance != null) return tmpInstance

            synchronized(this) {
                val instance = Room.databaseBuilder(
                    context.applicationContext,
                    FlashCardDB::class.java,
                    "flash_cards_database"
                ).build() //.fallbackToDestructiveMigration() will causes users to loose data during migrations (use only for testing purposes)
                INSTANCE = instance
                return instance
            }

```

tables

```
@Entity(tableName = "deck_table")
@Parcelize
data class Deck(
    @PrimaryKey @ColumnInfo(name = "id") val id: UUID = UUID.randomUUID(),
    @ColumnInfo(name = "title") var title: String,
    @ColumnInfo(name = "date") var date: Calendar,
    @ColumnInfo(name = "completed") var completed: Boolean
) : Parcelable {

@Entity(tableName = "card_table")
@Parcelize
data class FlashCard(
    @PrimaryKey @ColumnInfo(name = "id") val id: UUID = UUID.randomUUID(),
    @ColumnInfo(name = "parent_id") var pid: UUID,
    @ColumnInfo(name = "question") var question: String,
    @ColumnInfo(name = "answer") var answer: String,
    @ColumnInfo(name = "type") var type: CardType,
    @ColumnInfo(name = "completed") var completed: Boolean)
    : Parcelable {
}

```