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

Commit 1f704aa

Browse files
authored
マップ先の型がどんな形なのかを追記
1 parent f280008 commit 1f704aa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ This is a `RowMapper` like a `BeanPropertyRowMapper` for `Kotlin`.
88
You can call `KFunction`(e.g. `method reference`) from `ResultSet`.
99

1010
```kotlin
11+
data class Dst(
12+
foo: String,
13+
bar: String,
14+
baz: Int?,
15+
...
16+
)
17+
1118
// before
12-
val dst = jdbcTemplate.query(query) { rs, _ ->
19+
val dst: Dst = jdbcTemplate.query(query) { rs, _ ->
1320
Dst(
1421
rs.getString("foo"),
1522
rs.getString("bar"),
@@ -19,7 +26,7 @@ val dst = jdbcTemplate.query(query) { rs, _ ->
1926
}
2027

2128
// after
22-
val dst = jdbcTemplate.query(query, KRowMapper(::Dst))
29+
val dst: Dst = jdbcTemplate.query(query, KRowMapper(::Dst))
2330
```
2431

2532
## How to use

0 commit comments

Comments
 (0)