Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Niedermann <info@niedermann.it>2020-05-08 16:25:00 +0300
committerStefan Niedermann <info@niedermann.it>2020-05-08 16:25:00 +0300
commit2f2052d04090399e407b45546cc8ad288c987531 (patch)
treeb422b9d4cf7017e9f43d1405527b9a70677ff7d6 /app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java
parent3b75f8cf55f2d14027cfa2c388330c75cd3f6652 (diff)
Make basics for managing archived boards
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java')
-rw-r--r--app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java
index 778c212ba..ad01fd0b0 100644
--- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java
+++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java
@@ -13,12 +13,19 @@ import it.niedermann.nextcloud.deck.model.full.FullBoard;
@Dao
public interface BoardDao extends GenericDao<Board> {
+ @Query("SELECT * FROM board WHERE accountId = :accountId and archived = 1 and (deletedAt = 0 or deletedAt is null) and status <> 3 order by title asc")
+ LiveData<List<Board>> getArchivedBoardsForAccount(final long accountId);
+
@Query("SELECT * FROM board WHERE accountId = :accountId and archived = 0 and (deletedAt = 0 or deletedAt is null) and status <> 3 order by title asc")
- LiveData<List<Board>> getBoardsForAccount(final long accountId);
+ LiveData<List<Board>> getNonArchivedBoardsForAccount(final long accountId);
+
+ @Transaction
+ @Query("SELECT * FROM board WHERE accountId = :accountId and archived = 1 and (deletedAt = 0 or deletedAt is null) and status <> 3 order by title asc")
+ LiveData<List<FullBoard>> getArchivedFullBoards(long accountId);
@Transaction
@Query("SELECT * FROM board WHERE accountId = :accountId and archived = 0 and (deletedAt = 0 or deletedAt is null) and status <> 3 order by title asc")
- LiveData<List<FullBoard>> getFullBoards(long accountId);
+ LiveData<List<FullBoard>> getNonArchivedFullBoards(long accountId);
@Query("SELECT * FROM board WHERE accountId = :accountId and id = :remoteId")
LiveData<Board> getBoardByRemoteId(final long accountId, final long remoteId);