Categorize identities

This commit is contained in:
M66B
2021-10-14 14:27:21 +02:00
parent cdee290a16
commit 7befbb0186
4 changed files with 97 additions and 3 deletions

View File

@@ -32,13 +32,17 @@ public interface DaoIdentity {
@Query(TupleIdentityView.query)
LiveData<List<TupleIdentityView>> liveIdentityView();
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
@Query("SELECT identity.*" +
", account.name AS accountName, account.category AS accountCategory" +
", folder.id AS drafts" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" LEFT JOIN folder ON folder.account = account.id AND folder.type = '" + EntityFolder.DRAFTS + "'")
LiveData<List<TupleIdentityEx>> liveIdentities();
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
@Query("SELECT identity.*" +
", account.name AS accountName, account.category AS accountCategory" +
", folder.id AS drafts" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +
@@ -46,7 +50,9 @@ public interface DaoIdentity {
" AND account.synchronize")
LiveData<List<TupleIdentityEx>> liveComposableIdentities();
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
@Query("SELECT identity.*" +
", account.name AS accountName, account.category AS accountCategory" +
", folder.id AS drafts" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +