Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email

48 lines
1.6 KiB

  1. package eu.faircode.email;
  2. /*
  3. This file is part of FairEmail.
  4. FairEmail is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. NetGuard is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with NetGuard. If not, see <http://www.gnu.org/licenses/>.
  14. Copyright 2018 by Marcel Bokhorst (M66B)
  15. */
  16. import java.util.List;
  17. import androidx.lifecycle.LiveData;
  18. import androidx.room.Dao;
  19. import androidx.room.Insert;
  20. import androidx.room.Query;
  21. @Dao
  22. public interface DaoOperation {
  23. @Query("SELECT * FROM operation WHERE message = :message ORDER BY id")
  24. LiveData<List<EntityOperation>> getOperationsByMessage(long message);
  25. @Query("SELECT * FROM operation WHERE folder = :folder ORDER BY id")
  26. List<EntityOperation> getOperationsByFolder(long folder);
  27. @Query("SELECT * FROM operation ORDER BY id")
  28. LiveData<List<EntityOperation>> liveOperations();
  29. @Query("SELECT COUNT(id) FROM operation WHERE folder = :folder")
  30. int getOperationCount(long folder);
  31. @Insert
  32. long insertOperation(EntityOperation operation);
  33. @Query("DELETE FROM operation WHERE id = :id")
  34. void deleteOperation(long id);
  35. }