From c2110b08c9efdd2bb8a85da6aad0ac2cb72c673d Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Thu, 2 Sep 2021 13:36:02 +0200 Subject: [PATCH] MIgrate BaseDao to kotlin --- .../java/com/readrops/db/dao/BaseDao.java | 36 ------------------- .../main/java/com/readrops/db/dao/BaseDao.kt | 33 +++++++++++++++++ 2 files changed, 33 insertions(+), 36 deletions(-) delete mode 100644 db/src/main/java/com/readrops/db/dao/BaseDao.java create mode 100644 db/src/main/java/com/readrops/db/dao/BaseDao.kt diff --git a/db/src/main/java/com/readrops/db/dao/BaseDao.java b/db/src/main/java/com/readrops/db/dao/BaseDao.java deleted file mode 100644 index 3eebfe1c..00000000 --- a/db/src/main/java/com/readrops/db/dao/BaseDao.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.readrops.db.dao; - -import androidx.room.Delete; -import androidx.room.Insert; -import androidx.room.Update; - -import java.util.List; - -import io.reactivex.Completable; -import io.reactivex.Single; - -public interface BaseDao { - - @Insert - Single insert(T entity); - - // only here for compatibility with LocalFeedRepository - // which hasn't been written with rxjava usage in mind - @Insert - long compatInsert(T entity); - - @Insert - List insert(List entities); - - @Update - Completable update(T entity); - - @Update - Completable update(List entities); - - @Delete - Completable delete(T entity); - - @Delete - Completable delete(List entities); -} diff --git a/db/src/main/java/com/readrops/db/dao/BaseDao.kt b/db/src/main/java/com/readrops/db/dao/BaseDao.kt new file mode 100644 index 00000000..e070c04f --- /dev/null +++ b/db/src/main/java/com/readrops/db/dao/BaseDao.kt @@ -0,0 +1,33 @@ +package com.readrops.db.dao + +import androidx.room.Delete +import androidx.room.Insert +import androidx.room.Update +import io.reactivex.Completable +import io.reactivex.Single + +interface BaseDao { + + @Insert + fun insert(entity: T): Single + + // only here for compatibility with LocalFeedRepository + // which hasn't been written with rxjava usage in mind + @Insert + fun compatInsert(entity: T): Long + + @Insert + fun insert(entities: List?): List + + @Update + fun update(entity: T): Completable + + @Update + fun update(entities: List?): Completable + + @Delete + fun delete(entity: T): Completable + + @Delete + fun delete(entities: List?): Completable +} \ No newline at end of file