Prevent duplicate operation execution

This commit is contained in:
M66B
2019-01-29 15:57:05 +00:00
parent 7ddcc119e6
commit cdb84c72b3
2 changed files with 13 additions and 6 deletions

View File

@@ -44,7 +44,7 @@ public interface DaoOperation {
", id")
LiveData<List<TupleOperationEx>> liveOperations();
@Query("SELECT operation.* FROM operation" +
String GET_OPS_FOLDER = "SELECT operation.* FROM operation" +
" JOIN folder ON folder.id = operation.folder" +
" LEFT JOIN message ON message.id = operation.message" +
" LEFT JOIN account ON account.id = message.account" +
@@ -57,7 +57,12 @@ public interface DaoOperation {
" CASE WHEN folder.account IS NULL THEN -1 ELSE 1 END" + // outbox
" ELSE 0" +
" END" +
", id")
", id";
@Query(GET_OPS_FOLDER)
List<EntityOperation> getOperations(long folder);
@Query(GET_OPS_FOLDER)
LiveData<List<EntityOperation>> liveOperations(long folder);
@Query("SELECT * FROM operation ORDER BY id")