OneToMany fixes

This commit is contained in:
InsanusMokrassar committed 2021-06-16 13:20:05 +06:00
1 parent c3156f2e41
commit 261d8827e3
2 files changed
+15

No files matched your search

+4
View File
@@ -2,6 +2,10 @@
## 0.5.11
* `Repos`:
* `Common`:
* Fixes in `WriteOneToManyRepo#add`
## 0.5.10
* `Versions`
@@ -55,6 +55,17 @@ class OneToManyAndroidRepo<Key, Value>(
helper.blockingWritableTransaction {
for ((k, values) in toAdd) {
values.forEach { v ->
val kAsString = k.keyAsString()
val vAsString = v.valueAsString()
val isThere = select(tableName,
null,
"$idColumnName=? AND $valueColumnName=?",
arrayOf(kAsString, vAsString),
limit = limitClause(1)
).use { it.moveToFirst() }
if (isThere) {
return@forEach
}
insert(
tableName,
null,