Skip to content

Commit d509ebf

Browse files
committed
Convert StoryBookParagraphDao interface to Kotlin
1 parent aae0469 commit d509ebf

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed
Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
1-
package ai.elimu.content_provider.room.dao;
1+
package ai.elimu.content_provider.room.dao
22

3-
import android.database.Cursor;
4-
5-
import androidx.room.Dao;
6-
import androidx.room.Insert;
7-
import androidx.room.Query;
8-
import androidx.room.Update;
9-
10-
import java.util.List;
11-
12-
import ai.elimu.content_provider.room.entity.StoryBookParagraph;
3+
import ai.elimu.content_provider.room.entity.StoryBookParagraph
4+
import android.database.Cursor
5+
import androidx.room.Dao
6+
import androidx.room.Insert
7+
import androidx.room.Query
8+
import androidx.room.Update
139

1410
@Dao
15-
public interface StoryBookParagraphDao {
16-
11+
interface StoryBookParagraphDao {
1712
@Insert
18-
void insert(StoryBookParagraph storyBookParagraph);
13+
fun insert(storyBookParagraph: StoryBookParagraph)
1914

2015
@Query("SELECT * FROM StoryBookParagraph WHERE id = :id")
21-
StoryBookParagraph load(Long id);
16+
fun load(id: Long?): StoryBookParagraph?
2217

2318
@Query("SELECT * FROM StoryBookParagraph WHERE id = :id")
24-
Cursor loadAsCursor(Long id);
19+
fun loadAsCursor(id: Long?): Cursor?
2520

2621
@Query("SELECT * FROM StoryBookParagraph WHERE storyBookChapterId = :storyBookChapterId")
27-
List<StoryBookParagraph> loadAll(Long storyBookChapterId);
22+
fun loadAll(storyBookChapterId: Long?): MutableList<StoryBookParagraph?>?
2823

2924
@Query("SELECT * FROM StoryBookParagraph WHERE storyBookChapterId = :storyBookChapterId")
30-
Cursor loadAllAsCursor(Long storyBookChapterId);
25+
fun loadAllAsCursor(storyBookChapterId: Long?): Cursor
3126

3227
@Update
33-
void update(StoryBookParagraph storyBookParagraph);
28+
fun update(storyBookParagraph: StoryBookParagraph)
3429

3530
@Query("DELETE FROM StoryBookParagraph")
36-
void deleteAll();
31+
fun deleteAll()
3732
}

0 commit comments

Comments
 (0)