diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-08-07 15:28:02 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-08-07 15:28:02 +0000 |
commit | 425bc857cfe094d8b9be5815030ef3e6b0cf173d (patch) | |
tree | f1e4240531040bb20c9e840c123f03ce28a5f94e /app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java | |
parent | 7f2bc01180c284154fb69976122016c4638e9973 (diff) | |
download | infinity-for-reddit-425bc857cfe094d8b9be5815030ef3e6b0cf173d.tar infinity-for-reddit-425bc857cfe094d8b9be5815030ef3e6b0cf173d.tar.gz infinity-for-reddit-425bc857cfe094d8b9be5815030ef3e6b0cf173d.tar.bz2 infinity-for-reddit-425bc857cfe094d8b9be5815030ef3e6b0cf173d.tar.lz infinity-for-reddit-425bc857cfe094d8b9be5815030ef3e6b0cf173d.tar.xz infinity-for-reddit-425bc857cfe094d8b9be5815030ef3e6b0cf173d.tar.zst infinity-for-reddit-425bc857cfe094d8b9be5815030ef3e6b0cf173d.zip |
Refactored all the other classes to support multi user. Clearing the app data is required before launching the app.
Diffstat (limited to 'app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java')
-rw-r--r-- | app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java b/app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java index 711b02a6..513a1ea4 100644 --- a/app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java +++ b/app/src/main/java/SubscribedUserDatabase/SubscribedUserDao.java @@ -16,12 +16,12 @@ public interface SubscribedUserDao { @Query("DELETE FROM subscribed_users") void deleteAllSubscribedUsers(); - @Query("SELECT * FROM subscribed_users ORDER BY name COLLATE NOCASE ASC") - LiveData<List<SubscribedUserData>> getAllSubscribedUsers(); + @Query("SELECT * FROM subscribed_users WHERE username = :accountName ORDER BY name COLLATE NOCASE ASC") + LiveData<List<SubscribedUserData>> getAllSubscribedUsers(String accountName); - @Query("SELECT * FROM subscribed_users WHERE name = :userName COLLATE NOCASE LIMIT 1") - SubscribedUserData getSubscribedUser(String userName); + @Query("SELECT * FROM subscribed_users WHERE name = :name AND username = :accountName COLLATE NOCASE LIMIT 1") + SubscribedUserData getSubscribedUser(String name, String accountName); - @Query("DELETE FROM subscribed_users WHERE name = :userName") - void deleteSubscribedUser(String userName); + @Query("DELETE FROM subscribed_users WHERE name = :name AND username = :accountName") + void deleteSubscribedUser(String name, String accountName); } |