12 lines
425 B
Kotlin
12 lines
425 B
Kotlin
package ru.sicamp.sicamphelper.util
|
|
|
|
import org.jetbrains.exposed.dao.id.LongIdTable
|
|
import org.jetbrains.exposed.sql.select
|
|
|
|
@InTransaction
|
|
fun checkIds(table: LongIdTable, ids: List<Long>) {
|
|
val entityCount = table.select { table.id inList ids }.count()
|
|
if (entityCount != ids.size.toLong()) {
|
|
error("Not found some users from id list. Supposed to find ${ids.size}, found: $entityCount. Ids: $ids")
|
|
}
|
|
}
|