Skip to content

Conversation

litpho
Copy link

@litpho litpho commented Aug 10, 2022

The current Kotlin DSL does not yet allow for creating companion objects and/or const val's. Having this ability is useful for a number of reasons. One specific reason is to generate constants for column names. This allows custom result mappings to be a bit more typesafe, reducing the scope of typing errors further.

Example of a generated DynamicSqlSupport class and a custom mapper with typesafe columns:
mybatis-generator-pull-request.txt

@jeffgbutler jeffgbutler added this to the 1.4.2 milestone Aug 10, 2022
@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 88.348% when pulling 6453b2e on litpho:kotlin-companion-and-const-val into 1151bbd on mybatis:master.

@jeffgbutler jeffgbutler merged commit 73295b4 into mybatis:master Aug 10, 2022
@jeffgbutler
Copy link
Member

Nice job! Thank you for writing tests.

@litpho
Copy link
Author

litpho commented Aug 10, 2022

My pleasure. I've been using the framework since Abator, so it's about time.

@litpho litpho deleted the kotlin-companion-and-const-val branch August 10, 2022 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants