Dao修正

This commit is contained in:
ろむねこ 2024-01-22 20:00:45 +09:00
parent b87b635d2b
commit 253c77d6f5
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
2 changed files with 4 additions and 7 deletions

View File

@ -29,8 +29,8 @@ public interface DocumentDao {
@Query("SELECT * FROM Document WHERE id IN (:ids)") @Query("SELECT * FROM Document WHERE id IN (:ids)")
List<DocumentEntity> findByIds(List<String> ids); List<DocumentEntity> findByIds(List<String> ids);
@Query("SELECT * FROM Document WHERE public_path = :publicPath LIMIT :limit") @Query("SELECT * FROM Document WHERE parent_id = :parentId")
List<DocumentEntity> findByPublicPathWithLimit(String publicPath, int limit); List<DocumentEntity> findByParentId(String parentId);
@Query("SELECT * FROM Document ORDER BY created_at DESC LIMIT :limit") @Query("SELECT * FROM Document ORDER BY created_at DESC LIMIT :limit")
List<DocumentEntity> getRecentDocument(int limit); List<DocumentEntity> getRecentDocument(int limit);

View File

@ -15,11 +15,8 @@ public interface FolderDao {
@Query("SELECT * FROM Folder WHERE id = :id") @Query("SELECT * FROM Folder WHERE id = :id")
FolderEntity findById(String id); FolderEntity findById(String id);
@Query("SELECT * FROM Folder WHERE public_path = :publicPath") @Query("SELECT * FROM Folder WHERE parent_id = :parentId")
FolderEntity findByPublicPath(String publicPath); List<FolderEntity> findByParentId(String parentId);
@Query("SELECT * FROM Folder WHERE public_path = :publicPath LIMIT :limit")
List<FolderEntity> findByPublicPathWithLimit(String publicPath, int limit);
@Insert @Insert
void insert(FolderEntity folderEntity); void insert(FolderEntity folderEntity);