mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2026-11-03 02:23:22 +00:00
ExposedOneToManyKeyValueRepo fixes
This commit is contained in:
1 parent
261d8827e3
commit
96e97d1691
2 files changed
+5
No files matched your search
@@ -5,6 +5,8 @@
|
||||
* `Repos`:
|
||||
* `Common`:
|
||||
* Fixes in `WriteOneToManyRepo#add`
|
||||
* `Exposed`:
|
||||
* Fixes in `ExposedOneToManyKeyValueRepo#add`
|
||||
|
||||
## 0.5.10
|
||||
|
||||
|
||||
+3
@@ -31,6 +31,9 @@ open class ExposedOneToManyKeyValueRepo<Key, Value>(
|
||||
transaction(database) {
|
||||
toAdd.keys.flatMap { k ->
|
||||
toAdd[k] ?.mapNotNull { v ->
|
||||
if (select { keyColumn.eq(k).and(valueColumn.eq(v)) }.limit(1).count() > 0) {
|
||||
return@mapNotNull null
|
||||
}
|
||||
insertIgnore {
|
||||
it[keyColumn] = k
|
||||
it[valueColumn] = v
|
||||
|
||||
Reference in new issue
Block a user