(dao) crud interface

main
torrentcome 8 years ago
parent 78b0003cc7
commit ac3ef867c1
  1. 18
      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<TootEntity> loadAll();
@Query("SELECT * FROM TootEntity WHERE uid IN (:uid)")
List<TootEntity> loadAllByUserId(int... uid);
List<TootEntity> 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);
}

Loading…
Cancel
Save