Dao作成
This commit is contained in:
parent
3288b27cf0
commit
c5a39836cc
|
@ -0,0 +1,38 @@
|
|||
package one.nem.kidshift.data.room.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.OnConflictStrategy;
|
||||
import androidx.room.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import one.nem.kidshift.data.room.entity.HistoryCacheEntity;
|
||||
|
||||
@Dao
|
||||
public interface HistoryCacheDao {
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertHistory(HistoryCacheEntity history);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertHistoryList(List<HistoryCacheEntity> historyList);
|
||||
|
||||
@Query("SELECT * FROM history_cache WHERE id = :historyId")
|
||||
HistoryCacheEntity getHistory(String historyId);
|
||||
|
||||
@Query("SELECT * FROM history_cache")
|
||||
List<HistoryCacheEntity> getHistoryList();
|
||||
|
||||
@Query("SELECT * FROM history_cache WHERE child_id = :childId")
|
||||
List<HistoryCacheEntity> getHistoryListByChildId(String childId);
|
||||
|
||||
@Query("SELECT * FROM history_cache WHERE task_id = :taskId")
|
||||
List<HistoryCacheEntity> getHistoryListByTaskId(String taskId);
|
||||
|
||||
@Query("DELETE FROM history_cache WHERE id = :historyId")
|
||||
void deleteHistory(String historyId);
|
||||
|
||||
@Query("DELETE FROM history_cache WHERE child_id = :childId")
|
||||
void deleteHistoryByChildId(String childId);
|
||||
}
|
Loading…
Reference in New Issue
Block a user