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

Commit 44061df

Browse files
committed
README修正
1 parent 4b230ce commit 44061df

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ Also, it supports the default arguments which are peculiar to `Kotlin`.
103103
Also, by default, `KRowMapper` compares argument names and column names to see if they correspond.
104104
Therefore, in the case of "argument name is `camelCase` and column name is `snake_case`", it is necessary to pass a function that appropriately converts the naming convention of the argument name.
105105

106+
You can also pass a `ConversionService` for value conversion if needed.
107+
If you don't pass it, `DefaultConversionService.sharedInstance` will be used as default.
108+
106109
### Initialization from method reference(KFunction)
107110
You can initialize `KRowMapper` from `method reference(KFunction)` as follows It is.
108111

@@ -235,13 +238,16 @@ By using the contents described so far, you can perform more flexible and safe m
235238
In addition, by making full use of the abundant functions provided by `KRowMapper`, further labor saving is possible.
236239

237240
### Deserialization
238-
Since `KRowMapper` gets the value from `java.sql.ResultSet`, by default it is not possible to get the type which is not supported by this implementation.
239-
To deal with this problem, `KRowMapper` provides the following three types of deserialization methods in addition to the default conversion function.
241+
`KRowMapper` supports deserialization using the `ConversionService` (`DefaultConversionService.sharedInstance` by default).
242+
243+
In addition to this, as a more explicit and flexible deserialization method, `KRowMapper` provides the following three deserialization methods.
240244

241245
1. Deserialization by using the `KColumnDeserializer` annotation.
242246
2. Deserialization by creating your own custom deserialization annotations.
243247
3. Deserialization from multiple arguments.
244248

249+
These deserialization methods take precedence over deserialization by `ConversionService`.
250+
245251
#### Deserialization by using the KColumnDeserializer annotation
246252
If it is a self-made class and can be initialized from a single argument, deserialization using the `KColumnDeserializer` annotation can be used.
247253
`KColumnDeserializer` annotation can be used to `constructor` or `factory method` defined in `companion object`.
@@ -481,6 +487,3 @@ class Foo(
481487
val description: String = ""
482488
)
483489
```
484-
485-
#### Deserialize Enum
486-
If the value stored in the DB and the `Enum::name` property of the map destination are the same, it will be automatically converted to You can deserialize the `Enum`.

0 commit comments

Comments
 (0)