Refactoring composables

This commit is contained in:
M66B
2019-02-10 17:39:27 +00:00
parent 3edfb7b0bf
commit d5dd01db6e
5 changed files with 134 additions and 124 deletions

View File

@@ -37,8 +37,18 @@ public interface DaoIdentity {
@Query("SELECT identity.*, account.name AS accountName FROM identity" +
" JOIN account ON account.id = identity.account" +
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +
" WHERE identity.synchronize AND account.synchronize")
List<TupleIdentityEx> getComposableIdentities();
" WHERE :account IS NULL OR identity.account = :account" +
" AND identity.synchronize" +
" AND account.synchronize")
List<TupleIdentityEx> getComposableIdentities(Long account);
@Query("SELECT identity.*, account.name AS accountName FROM identity" +
" JOIN account ON account.id = identity.account" +
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +
" WHERE :account IS NULL OR identity.account = :account" +
" AND identity.synchronize" +
" AND account.synchronize")
LiveData<List<TupleIdentityEx>> liveComposableIdentities(Long account);
@Query("SELECT * FROM identity WHERE account = :account")
List<EntityIdentity> getIdentities(long account);