dave08
01/03/2023, 5:03 PMToshihiro Nakamura
01/03/2023, 11:01 PMdave08
01/04/2023, 12:05 PMdave08
01/04/2023, 12:06 PMToshihiro Nakamura
01/04/2023, 12:24 PMbut if it would be used many times, remapping could get to be error-prone.Why not make the mapping code common?
programmatical mapping would only fail at run time.If mapping without reflection, you can detect errors at compile time. As a point of reference, parts of a query can be reused as common parts. https://github.com/komapper/komapper-examples/blob/v1.5.0/repository-pattern-jdbc/src/main/kotlin/org/komapper/example/ExampleRepository.kt
dave08
01/04/2023, 2:14 PM@KomapperIgnore val foo: SomeEnum? = null
and then used:
store.oneToOne(a, ia).map { it.key.copy(foo = it.value?.foo) }
To copy the field from the entitystore...