|
@ -23,27 +23,23 @@ import java.util.List; |
|
|
|
|
|
|
|
|
import androidx.room.Dao; |
|
|
import androidx.room.Dao; |
|
|
import androidx.room.Insert; |
|
|
import androidx.room.Insert; |
|
|
import androidx.room.OnConflictStrategy; |
|
|
|
|
|
import androidx.room.Query; |
|
|
import androidx.room.Query; |
|
|
import androidx.room.Update; |
|
|
import androidx.room.Update; |
|
|
|
|
|
|
|
|
@Dao |
|
|
@Dao |
|
|
public interface DaoOperation { |
|
|
public interface DaoOperation { |
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE) |
|
|
|
|
|
long insertOperation(EntityOperation operation); |
|
|
|
|
|
|
|
|
|
|
|
@Query("SELECT * FROM operation WHERE folder = :folder ORDER BY id") |
|
|
@Query("SELECT * FROM operation WHERE folder = :folder ORDER BY id") |
|
|
List<EntityOperation> getOperations(long folder); |
|
|
List<EntityOperation> getOperations(long folder); |
|
|
|
|
|
|
|
|
@Query("SELECT COUNT(id) FROM operation WHERE folder = :folder") |
|
|
@Query("SELECT COUNT(id) FROM operation WHERE folder = :folder") |
|
|
int getOperationCount(long folder); |
|
|
int getOperationCount(long folder); |
|
|
|
|
|
|
|
|
|
|
|
@Insert |
|
|
|
|
|
long insertOperation(EntityOperation operation); |
|
|
|
|
|
|
|
|
@Update |
|
|
@Update |
|
|
void updateOperation(EntityOperation operation); |
|
|
void updateOperation(EntityOperation operation); |
|
|
|
|
|
|
|
|
@Query("DELETE FROM operation WHERE id = :id") |
|
|
@Query("DELETE FROM operation WHERE id = :id") |
|
|
void deleteOperation(long id); |
|
|
void deleteOperation(long id); |
|
|
|
|
|
|
|
|
@Query("DELETE FROM operation WHERE message = :id AND name = :name") |
|
|
|
|
|
int deleteOperations(long id, String name); |
|
|
|
|
|
} |
|
|
} |