diff options
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/User/UserDao.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/src/main/java/User/UserDao.java b/app/src/main/java/User/UserDao.java new file mode 100644 index 00000000..ec6bb7e2 --- /dev/null +++ b/app/src/main/java/User/UserDao.java @@ -0,0 +1,18 @@ +package User; + +import android.arch.persistence.room.Dao; +import android.arch.persistence.room.Insert; +import android.arch.persistence.room.OnConflictStrategy; +import android.arch.persistence.room.Query; + +@Dao +public interface UserDao { + @Insert(onConflict = OnConflictStrategy.REPLACE) + void insert(User user); + + @Query("DELETE FROM users") + void deleteAllUsers(); + + @Query("SELECT * FROM users WHERE user_name = :userName LIMIT 1") + User getUserData(String userName); +} |