We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code to reproduce this issue:
enum class Status(val code: Int) { ONE(1), TWO(2), THREE(3); companion object { fun forCode(code: Int): Status { return values().first { it.code == code } } } } @Test fun testTransformingNullValues() { val t = object : Table<Nothing>("T_TEST_TRANSFORMING_NULL_VALUES") { val status = int("STATUS").transform({ Status.forCode(it) }, { it.code }) } database.useConnection { conn -> conn.createStatement().use { statement -> val sql = """CREATE TABLE T_TEST_TRANSFORMING_NULL_VALUES(STATUS INT)""" statement.executeUpdate(sql) } } database.insert(t) { set(it.status, null) } val query = database.from(t).select(t.status) assert(query.map { row -> row[t.status] }.first() == null) }
Throwing the exception:
The text was updated successfully, but these errors were encountered:
Maybe you can change your code to this
enum class Status(val code: Int) { ONE(1), TWO(2), THREE(3); companion object { fun forCode(code: Int?): Status? { return values().firstOrNull { it.code == code } } } }
Sorry, something went wrong.
f80e8c4
No branches or pull requests
Code to reproduce this issue:
Throwing the exception:
The text was updated successfully, but these errors were encountered: