package com.fun.funnyprank.data;

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

import java.util.List;

@Dao
public interface LikeDAO {
    @Query("SELECT * FROM like_table")
    List<LikeData> getAll();

    @Query("select * from like_table where islike =:islike ")
    List<LikeData> getLikedata(boolean islike);

    @Query("select * from like_table where title =:title ")
    List<LikeData> getliketitle(String title);

    @Query("select * from like_table where categoryname =:name ")
    List<LikeData> getlist(String name);

    @Insert
    void insertAll(List<LikeData> likeDataList);

    @Query("DELETE FROM like_table WHERE id = :id")
    void deleteCutsom(int id);

    @Query("select * from like_table where categoryname =:name ")
    LiveData<List<LikeData>> getCustom(String name);

    @Query("select * from like_table where isRank =:isrank ")
    LiveData<List<LikeData>> getRankdata(boolean isrank);

    @Query("SELECT * FROM like_table")
    LiveData<List<LikeData>> livegetAll();

    @Query("select * from like_table where islike =:islike ")
    LiveData<List<LikeData>> getLikelist(boolean islike);

    @Insert
    void insertCustom(LikeData mydata);

    @Update
    void update(LikeData likeData);
}
