release/2.0 #21

Merged
fabian merged 137 commits from release/2.0 into master 2023-01-28 23:29:27 +01:00
3 changed files with 19 additions and 12 deletions
Showing only changes of commit bdc9b64c63 - Show all commits

View File

@@ -0,0 +1,17 @@
package me.zobrist.tichucounter.data
import androidx.room.*
import kotlinx.coroutines.flow.Flow
@Dao
interface DaoBase<T> {
@Insert
fun insert(entity: T): Long
@Update
fun update(entity: T)
@Delete
fun delete(entity: T)
}

View File

@@ -5,7 +5,7 @@ import kotlinx.coroutines.flow.Flow
@Dao @Dao
interface GameDao { interface GameDao: DaoBase<Game> {
@Query("SELECT * FROM game") @Query("SELECT * FROM game")
fun getAll(): Flow<List<Game>> fun getAll(): Flow<List<Game>>
@@ -22,12 +22,4 @@ interface GameDao {
@Query("UPDATE game SET active = 0 WHERE uid is not :gameId;") @Query("UPDATE game SET active = 0 WHERE uid is not :gameId;")
fun setOthersInactive(gameId: Long) fun setOthersInactive(gameId: Long)
@Insert
fun insert(game: Game): Long
@Update
fun update(game: Game)
@Delete
fun delete(round: Game)
} }

View File

@@ -7,7 +7,7 @@ import androidx.room.Query
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
@Dao @Dao
interface RoundDao { interface RoundDao: DaoBase<Round> {
@Query("SELECT * FROM round") @Query("SELECT * FROM round")
fun getAll(): Flow<List<Round>> fun getAll(): Flow<List<Round>>
@@ -18,6 +18,4 @@ interface RoundDao {
@Insert @Insert
fun insertAll(vararg rounds: Round) fun insertAll(vararg rounds: Round)
@Delete
fun delete(round: Round)
} }