package xn.hxp.room.dao.cabinet;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

import xn.hxp.room.bean.cabinet.CabinetDoor;

@Dao
public interface CabinetDoorDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(CabinetDoor cabinetDoor);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(List<CabinetDoor> cabinetDoorList);


    @Query("SELECT * FROM cabinetdoor")
    List<CabinetDoor> getCabinetDoorList();

    @Update
    void update(CabinetDoor cabinetDoor);

    @Delete
    void delete(CabinetDoor cabinetDoor);

    @Query("DELETE FROM cabinetdoor")
    void deleteAll();
}
