Initialize on demand

This commit is contained in:
M66B
2020-12-31 14:12:21 +01:00
parent a71ca7b35a
commit 4a973e38d8
2 changed files with 43 additions and 24 deletions

View File

@@ -133,8 +133,11 @@ public interface DaoOperation {
@Query("UPDATE operation SET state = :state WHERE id = :id AND NOT (state IS :state)")
int setOperationState(long id, String state);
@Query("UPDATE operation SET state = NULL WHERE state IS NOT NULL")
int resetOperationStates();
@Query("UPDATE operation SET state = NULL" +
" WHERE account = :account" +
" AND state IS NOT NULL" +
" AND name <> '" + EntityOperation.SEND + "'")
int resetOperationStates(long account);
@Query("UPDATE operation SET error = :error WHERE id = :id AND NOT (error IS :error)")
int setOperationError(long id, String error);