package com.framework.mvvm.model.db.dao

import androidx.room.*
import com.framework.mvvm.model.db.entity.RelationEntity

/**
 * 表 relation Dao
 */
@Dao
interface RelationDao {
    @Query("select * from relation")
    suspend fun getRelations(): List<RelationEntity>

    @Query("select * from relation where id = :id")
    suspend fun getRelationById(id: String): RelationEntity

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insRelation(vararg relation: RelationEntity)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insRelations(relations: List<RelationEntity>)

    @Delete
    suspend fun delRelation(relation: RelationEntity)
}