mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-21 08:07:16 +00:00
ExposedOneToManyKeyValueRepo fixes
This commit is contained in:
parent
261d8827e3
commit
96e97d1691
@ -5,6 +5,8 @@
|
|||||||
* `Repos`:
|
* `Repos`:
|
||||||
* `Common`:
|
* `Common`:
|
||||||
* Fixes in `WriteOneToManyRepo#add`
|
* Fixes in `WriteOneToManyRepo#add`
|
||||||
|
* `Exposed`:
|
||||||
|
* Fixes in `ExposedOneToManyKeyValueRepo#add`
|
||||||
|
|
||||||
## 0.5.10
|
## 0.5.10
|
||||||
|
|
||||||
|
@ -31,6 +31,9 @@ open class ExposedOneToManyKeyValueRepo<Key, Value>(
|
|||||||
transaction(database) {
|
transaction(database) {
|
||||||
toAdd.keys.flatMap { k ->
|
toAdd.keys.flatMap { k ->
|
||||||
toAdd[k] ?.mapNotNull { v ->
|
toAdd[k] ?.mapNotNull { v ->
|
||||||
|
if (select { keyColumn.eq(k).and(valueColumn.eq(v)) }.limit(1).count() > 0) {
|
||||||
|
return@mapNotNull null
|
||||||
|
}
|
||||||
insertIgnore {
|
insertIgnore {
|
||||||
it[keyColumn] = k
|
it[keyColumn] = k
|
||||||
it[valueColumn] = v
|
it[valueColumn] = v
|
||||||
|
Loading…
Reference in New Issue
Block a user