diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-06-05 01:04:47 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-06-05 01:04:47 +0200 |
commit | c8dd3414bfa8ade64383bfe95811ea54088fa6d6 (patch) | |
tree | ae74cf80a33f852a345c3b83d9c352221a2c3ab3 /kvision-server/src/main/kotlin/pl/treksoft/kvision | |
parent | d897d72fd38e979d74bd08dc23196d0240c58989 (diff) | |
download | kvision-c8dd3414bfa8ade64383bfe95811ea54088fa6d6.tar.gz kvision-c8dd3414bfa8ade64383bfe95811ea54088fa6d6.tar.bz2 kvision-c8dd3414bfa8ade64383bfe95811ea54088fa6d6.zip |
Kwery converter for KDate type fix.
Diffstat (limited to 'kvision-server/src/main/kotlin/pl/treksoft/kvision')
-rw-r--r-- | kvision-server/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt | 5 |
1 files changed, 3 insertions, 2 deletions
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<KDate>( - { row, c -> KDate(row.date(c).time) }, - { it.toJava() } + { row, c -> KDate(row.timestamp(c).time) }, + { Timestamp(it.time) } ) val kvTableConfig = TableConfiguration( |