We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dabac4c commit 59c54baCopy full SHA for 59c54ba
1 file changed
common/src/main/java/com/imsproject/common/dataAccess/OfflineResultSet.kt
@@ -84,7 +84,12 @@ class OfflineResultSet(rs: ResultSet) {
84
85
fun getLocalDateTime(columnName: String): LocalDateTime? {
86
val obj = getObject(columnName) ?: return null
87
- return LocalDateTime.parse(obj as String, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
+ return when (obj) {
88
+ is LocalDateTime -> obj
89
+ is java.sql.Timestamp -> obj.toLocalDateTime()
90
+ is String -> LocalDateTime.parse(obj, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
91
+ else -> throw IllegalArgumentException("Unsupported type for LocalDateTime: ${obj::class.java.name}")
92
+ }
93
}
94
95
inline fun <reified T> getEnum(columnName: String): T? {
0 commit comments