mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Fix: Put of repositoryDao
This commit is contained in:
parent
6aab888c0f
commit
73caf07ba1
@ -22,8 +22,16 @@ interface BaseDao<T> {
|
|||||||
|
|
||||||
@Dao
|
@Dao
|
||||||
interface RepositoryDao : BaseDao<Repository> {
|
interface RepositoryDao : BaseDao<Repository> {
|
||||||
fun put(repository: Repository) {
|
fun put(repository: com.looker.droidify.entity.Repository) {
|
||||||
if (repository.id >= 0L) update(repository) else insert(repository)
|
repository.let {
|
||||||
|
val dbRepo = Repository().apply {
|
||||||
|
id = it.id
|
||||||
|
enabled = if (it.enabled) 1 else 0
|
||||||
|
deleted = 0
|
||||||
|
data = it
|
||||||
|
}
|
||||||
|
if (repository.id >= 0L) update(dbRepo) else insert(dbRepo)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Query("SELECT * FROM repository WHERE _id = :id and deleted == 0")
|
@Query("SELECT * FROM repository WHERE _id = :id and deleted == 0")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user