Prefer primary identity

This commit is contained in:
M66B 2019-12-06 14:50:15 +01:00
parent 6be65f7cf8
commit ea64f2f308
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,8 @@ public interface DaoIdentity {
@Query("SELECT identity.* FROM identity" +
" JOIN account ON account.id = identity.account" +
" WHERE identity.account = :account" +
" AND identity.synchronize AND account.synchronize")
" AND identity.synchronize AND account.synchronize" +
" ORDER BY identity.`primary` DESC, IFNULL(identity.display, identity.name)")
List<EntityIdentity> getSynchronizingIdentities(long account);
@Query("SELECT COUNT(*) FROM identity WHERE synchronize")