From c8dd3414bfa8ade64383bfe95811ea54088fa6d6 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 5 Jun 2018 01:04:47 +0200 Subject: Kwery converter for KDate type fix. --- kvision-server/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kvision-server/src') diff --git a/kvision-server/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt b/kvision-server/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt index ad4185d6..2923a394 100644 --- a/kvision-server/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt +++ b/kvision-server/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt @@ -26,6 +26,7 @@ import com.github.andrewoma.kwery.mapper.TableConfiguration import com.github.andrewoma.kwery.mapper.reifiedConverter import com.github.andrewoma.kwery.mapper.standardConverters import com.github.andrewoma.kwery.mapper.util.camelToLowerUnderscore +import java.sql.Timestamp import java.text.SimpleDateFormat import java.util.* @@ -47,8 +48,8 @@ internal actual fun KDate.toStringF(format: String) = fun KDate.toJava(): java.util.Date = java.util.Date(this.time) object KDateConverter : SimpleConverter( - { row, c -> KDate(row.date(c).time) }, - { it.toJava() } + { row, c -> KDate(row.timestamp(c).time) }, + { Timestamp(it.time) } ) val kvTableConfig = TableConfiguration( -- cgit