From c74b14aa8d6de4264d58b5a430da5bbc49448fbe Mon Sep 17 00:00:00 2001 From: "Andrey.Tarashevskiy" Date: Sun, 24 May 2020 01:33:26 +0300 Subject: [PATCH] Fixed cast int primary key to long / recursive --- .../src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt index ed2f1218df..710f6a2845 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt @@ -269,10 +269,7 @@ private fun FieldSet.selectBatched( } private fun toLong(autoIncVal: Any): Long = when (autoIncVal) { - is EntityID<*> -> when (val value = autoIncVal.value) { - is Int -> value.toLong() - else -> value as Long - } + is EntityID<*> ->toLong(autoIncVal.value) is Int -> autoIncVal.toLong() else -> autoIncVal as Long }