Insertを追加

This commit is contained in:
ろむねこ 2023-12-14 11:55:20 +09:00
parent 423993b53e
commit 31799218a9
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -1,6 +1,7 @@
package one.nem.lacerta.source.database.dao; package one.nem.lacerta.source.database.dao;
import androidx.room.Dao; import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query; import androidx.room.Query;
import java.util.List; import java.util.List;
@ -10,6 +11,7 @@ import one.nem.lacerta.source.database.entity.LibraryEntity;
@Dao @Dao
public interface LibraryDao { public interface LibraryDao {
// Select
@Query("SELECT * FROM Library WHERE id = :id") @Query("SELECT * FROM Library WHERE id = :id")
LibraryEntity findById(String id); LibraryEntity findById(String id);
@ -19,6 +21,17 @@ public interface LibraryDao {
@Query("SELECT * FROM Library WHERE id IN (:ids)") @Query("SELECT * FROM Library WHERE id IN (:ids)")
List<LibraryEntity> findByIds(List<String> ids); List<LibraryEntity> findByIds(List<String> ids);
// WIP
// TODO-rca: Insert, Update, Delete // Insert
@Insert
void insert(LibraryEntity libraryEntity);
@Insert
void insertAll(LibraryEntity... libraryEntities);
@Insert
void insertAll(List<LibraryEntity> libraryEntities);
// Update
// TODO-rca: 未実装
} }