(dao) crud interface
This commit is contained in:
parent
fec8e5c47c
commit
9d21c36758
|
@ -4,27 +4,33 @@ import android.arch.persistence.room.Dao;
|
||||||
import android.arch.persistence.room.Delete;
|
import android.arch.persistence.room.Delete;
|
||||||
import android.arch.persistence.room.Insert;
|
import android.arch.persistence.room.Insert;
|
||||||
import android.arch.persistence.room.Query;
|
import android.arch.persistence.room.Query;
|
||||||
|
import android.arch.persistence.room.Update;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cto3543 on 28/06/2017.
|
* Created by cto3543 on 28/06/2017.
|
||||||
|
* crud interface on this Toot DB
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Dao
|
@Dao
|
||||||
public interface TootDao {
|
public interface TootDao {
|
||||||
|
// c
|
||||||
|
@Insert
|
||||||
|
long insert(TootEntity users);
|
||||||
|
|
||||||
|
// r
|
||||||
@Query("SELECT * FROM TootEntity")
|
@Query("SELECT * FROM TootEntity")
|
||||||
List<TootEntity> loadAll();
|
List<TootEntity> loadAll();
|
||||||
|
|
||||||
@Query("SELECT * FROM TootEntity WHERE uid IN (:uid)")
|
@Query("SELECT * FROM TootEntity WHERE uid IN (:uid)")
|
||||||
List<TootEntity> loadAllByUserId(int... uid);
|
List<TootEntity> loadAllByTootId(int... uid);
|
||||||
|
|
||||||
@Insert
|
// u
|
||||||
long insert(TootEntity users);
|
@Update
|
||||||
|
void updateToot(TootEntity... toot);
|
||||||
@Insert
|
|
||||||
void insertAll(TootEntity... users);
|
|
||||||
|
|
||||||
|
// d
|
||||||
@Delete
|
@Delete
|
||||||
void delete(TootEntity user);
|
void delete(TootEntity user);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue