Rev 14 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
package com.cesams.twogetskills.inconcert.dao;import androidx.room.Dao;import androidx.room.Insert;import androidx.room.Query;import androidx.room.Update;import com.cesams.twogetskills.inconcert.entity.Capsule;import com.cesams.twogetskills.inconcert.room.ResultCount;import java.util.List;@Daopublic interface CapsuleDao {@Query("SELECT * FROM tb_capsules ORDER BY position, name")List<Capsule> selectAll();@Query("SELECT * FROM tb_capsules WHERE topic_uuid = :topicUuid ORDER BY position, name")List<Capsule> selectAllByTopicUuid(String topicUuid);@Query("SELECT * FROM tb_capsules WHERE topic_uuid = :topicUuid ORDER BY added_on DESC")List<Capsule> selectAllByTopicUuidandOrder(String topicUuid);@Query("SELECT * FROM tb_capsules WHERE uuid = :uuid LIMIT 1")Capsule selectByUuid(String uuid);@Query("SELECT COUNT(*) AS count FROM tb_capsules WHERE topic_uuid = :topicUuid LIMIT 1")ResultCount getCountByTopicUuid(String topicUuid);@Query("SELECT COUNT(*) AS count FROM tb_capsules LIMIT 1")ResultCount getCount();@Insertvoid insert(Capsule capsule);@Updatevoid update(Capsule capsule);@Query("DELETE FROM tb_capsules WHERE uuid = :uuid")void removeByUuid(String uuid);@Query("DELETE FROM tb_capsules")void removeAll();}