I ended up writing my own data type that gets the ...
# komapper
I ended up writing my own data type that gets the clob as a string... but what about having a data type that depends on an annotation instead of a new class? Say:
Copy code
data class FooEntity(@KomapperType(ClobStringType::class) val sometext: String)
I would like to recommend another way. How about converting
to your own data type. I think you can use Data type conversion. https://www.komapper.org/docs/reference/data-type/#data-type-conversion
It's not easy to create one from a string, you need a connection... Does a mapper have one?
Ah, I see. Then, perhaps a user-defined data type might be more suitable. You can get a Connection from the PreparedStatement parameter of the setValue function. https://www.komapper.org/docs/reference/data-type/#user-defined-data-types-for-jdbc
Yeah, but it's a bit of a waste to have to create all those extra wrapper objects -- unless user defined data types can use value classes? But that would still mean to access these fields indirectly through the value class's property...
Nope, it seems like value classes ignore the user defined data types...