package com.sunny.app.soft.timberkeyboardnew.room;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.sunny.app.soft.timberkeyboardnew.data.entity.CategoryEntity;

import java.util.List;

@Dao
public interface CategoryDao {

    @Insert(onConflict = OnConflictStrategy.IGNORE)
    long insertData(CategoryEntity data);


    @Query("select * from category order by id desc")
    LiveData<List<CategoryEntity>> queryAll();

    @Query("select * from category  where name = :mtitle")
    CategoryEntity queryCateId(String mtitle);

    @Query("select * from category order by id desc")
    List<CategoryEntity> queryAllData();


}
