Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit 7607421

Browse files
committed
カラム名変換を追記
1 parent c35bcec commit 7607421

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ val dst: Dst = jdbcTemplate.query(query) { rs, _ ->
2929
val dst: Dst = jdbcTemplate.query(query, KRowMapper(::Dst))
3030
```
3131

32+
## Usage
33+
### Convert Naming conventions
34+
`KRowMapper` searches columns by default in camel case.
35+
If the DB is named in snake case, mapping can be done by passing a conversion function(e.g. defined in `JackSon`, `Guava`) to `KRowMapper`.
36+
37+
```kotlin
38+
// if use Guava.
39+
KRowMapper(::Dst) { colName: String ->
40+
CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, colName)
41+
}
42+
```
43+
3244
## Installation
3345
Published on JitPack.
3446
You can use this library on `maven`, `gradle` and any other build tools.

0 commit comments

Comments
 (0)