From 0804bfb8f65ad981c5f4e6abe44e5c14c560b97c Mon Sep 17 00:00:00 2001 From: r-ca Date: Wed, 13 Dec 2023 18:44:51 +0900 Subject: [PATCH] =?UTF-8?q?Repositories=20Dao=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/db/dao/RepositoriesDao.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 data/src/main/java/one/nem/lacerta/source/db/dao/RepositoriesDao.java diff --git a/data/src/main/java/one/nem/lacerta/source/db/dao/RepositoriesDao.java b/data/src/main/java/one/nem/lacerta/source/db/dao/RepositoriesDao.java new file mode 100644 index 00000000..ad87de1c --- /dev/null +++ b/data/src/main/java/one/nem/lacerta/source/db/dao/RepositoriesDao.java @@ -0,0 +1,25 @@ +package one.nem.lacerta.source.db.dao; + +import androidx.room.Dao; +import androidx.room.Query; + +import java.util.List; + +import one.nem.lacerta.source.db.entity.Repositories; + +@Dao +public interface RepositoriesDao { + + @Query("SELECT * FROM repositories") + List getAll(); + + @Query("SELECT * FROM repositories WHERE id IN (:ids)") + List loadAllByIds(int[] ids); + + @Query("SELECT * FROM repositories WHERE relative_path LIKE :relativePath LIMIT 1") + Repositories findByRelativePath(String relativePath); + + @Query("SELECT * FROM repositories WHERE id LIKE :id LIMIT 1") + Repositories findById(String id); + +}