Skip to content

BeanPropertyRowMapper's support for direct column name matches is missing in DataClassRowMapper #28243

@madorb

Description

@madorb

Presently DataClassRowMapper appears to assume that all database columns use snake_case

Say I have a kotlin class like:

data class MyClass(val myFoo: String, val myBar: String)

and a database table with columns myFoo, myBar

a naive selection like

select myFoo, myBar
FROM ...

will fail, because the mapper will expect the columns to be named with underscores.

This can be worked around by adding aliases with underscores:

select myFoo as my_foo, myBar as my_bar
FROM ...

But this is less than ideal. Ideally this would be configurable and support a few standard formats out of the box, e.g. snake_case, camelCase, PascalCase.

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions