Single sync service

This commit is contained in:
M66B
2019-03-01 19:35:30 +00:00
parent 67ec1908aa
commit c0983d24f5
9 changed files with 62 additions and 238 deletions

View File

@@ -32,8 +32,13 @@ public interface DaoAccount {
@Query("SELECT * FROM account")
List<EntityAccount> getAccounts();
@Query("SELECT * FROM account WHERE synchronize")
List<EntityAccount> getSynchronizingAccounts();
@Query("SELECT account.* FROM account" +
" LEFT JOIN folder ON folder.account = account.id" + // not outbox
" LEFT JOIN operation ON operation.folder = folder.id" +
" WHERE account.synchronize" +
" GROUP BY account.id" +
" HAVING :all OR COUNT(operation.id) > 0")
List<EntityAccount> getSynchronizingAccounts(boolean all);
@Query("SELECT * FROM account WHERE tbd = 1")
List<EntityAccount> getAccountsTbd();