ToxiテーブルDao実装WIP

This commit is contained in:
r-ca 2024-01-27 17:09:52 +09:00
parent e43c3beda0
commit 4ffcd970b4
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -1,7 +1,35 @@
package one.nem.lacerta.source.database.dao;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
import one.nem.lacerta.source.database.entity.ToxiDocumentEntity;
@Dao
public interface ToxiDocumentDao {
@Query("SELECT * FROM toxi_document WHERE parent_document_id = :parentId AND is_active = 1 ORDER BY `order` ASC")
List<ToxiDocumentEntity> findByParentId(String parentId);
@Insert
void insert(ToxiDocumentEntity toxiDocument);
@Insert
void insertAll(ToxiDocumentEntity... toxiDocuments);
@Update
void update(ToxiDocumentEntity toxiDocument);
@Update
void updateAll(ToxiDocumentEntity... toxiDocuments);
@Query("DELETE FROM toxi_document WHERE parent_document_id = :parentId")
void deleteByParentId(String parentId);
@Query("DELETE FROM toxi_document WHERE parent_document_id = :parentId AND child_document_id = :childId")
void deleteByParentIdAndChildId(String parentId, String childId);
}