From 9d21c36758f1a778a79e1dca8429574d4cd76bea Mon Sep 17 00:00:00 2001 From: torrentcome Date: Thu, 29 Jun 2017 12:01:14 +0200 Subject: [PATCH] (dao) crud interface --- .../com/keylesspalace/tusky/db/TootDao.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/db/TootDao.java b/app/src/main/java/com/keylesspalace/tusky/db/TootDao.java index 39ea0e5e5..373f7b949 100644 --- a/app/src/main/java/com/keylesspalace/tusky/db/TootDao.java +++ b/app/src/main/java/com/keylesspalace/tusky/db/TootDao.java @@ -4,27 +4,33 @@ import android.arch.persistence.room.Dao; import android.arch.persistence.room.Delete; import android.arch.persistence.room.Insert; import android.arch.persistence.room.Query; +import android.arch.persistence.room.Update; import java.util.List; /** * Created by cto3543 on 28/06/2017. + * crud interface on this Toot DB */ @Dao public interface TootDao { + // c + @Insert + long insert(TootEntity users); + + // r @Query("SELECT * FROM TootEntity") List loadAll(); @Query("SELECT * FROM TootEntity WHERE uid IN (:uid)") - List loadAllByUserId(int... uid); + List loadAllByTootId(int... uid); - @Insert - long insert(TootEntity users); - - @Insert - void insertAll(TootEntity... users); + // u + @Update + void updateToot(TootEntity... toot); + // d @Delete void delete(TootEntity user); }