Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Provide KotlinMapper as rowMapper for Dao/DaoOfAny #14

Description

@stapel

JDBI supports proper mapping to Kotlin-classes via the jdbi3-kotlin plugin. The DaoOfAny class from jdbiorm only provides a Java-FieldMapper, this works to some extent with Kotlin.

The FieldMapper requires you to use default-values for all data-class properties, because the data class will be constructed using the default constructor () and filled afterwards. The KotlinMapper directly constructs the data class with the values provided (properties not present in the constructer will be filled afterwards).

Better and further description can be found here: https://github.com/jdbi/jdbi/tree/master/kotlin

Maybe vok-orm could provide/register the plugin and convenience-classes like:

open class KtDao<T : AbstractEntity<ID>, ID>(entityClass: Class<T>) : Dao<T, ID>(entityClass) {
	override fun getRowMapper(): RowMapper<T> = KotlinMapper(entityClass) as RowMapper<T>
}

.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions