Dao実装

This commit is contained in:
ろむねこ 2024-01-25 15:49:53 +09:00
parent 396c5e914f
commit 05915a2f4e
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -10,4 +10,28 @@ import one.nem.lacerta.source.database.entity.ToxiDocumentTagEntity;
@Dao
public interface ToxiDocumentTagDao {
@Query("SELECT * FROM toxi_document_tag WHERE document_id = :documentId")
List<ToxiDocumentTagEntity> findByDocumentId(String documentId);
@Query("SELECT * FROM toxi_document_tag WHERE tag_id = :tagId")
List<ToxiDocumentTagEntity> findByTagId(String tagId);
@Insert
void insert(ToxiDocumentTagEntity toxiDocumentTag);
@Insert
void insertAll(ToxiDocumentTagEntity... toxiDocumentTags);
@Insert
void insertAll(List<ToxiDocumentTagEntity> toxiDocumentTags);
@Query("DELETE FROM toxi_document_tag WHERE document_id = :documentId")
void deleteByDocumentId(String documentId);
@Query("DELETE FROM toxi_document_tag WHERE tag_id = :tagId")
void deleteByTagId(String tagId);
@Query("DELETE FROM toxi_document_tag WHERE document_id = :documentId AND tag_id = :tagId")
void deleteByDocumentIdAndTagId(String documentId, String tagId);
}