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.Cabinet;

@Dao
public interface CabinetDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(Cabinet cabinet);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(List<Cabinet> cabinetList);


    @Query("SELECT * FROM cabinet")
    List<Cabinet> getCabinetList();

    @Update
    void update(Cabinet cabinet);

    @Delete
    void delete(Cabinet cabinet);

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