Skip to content

Commit 1fcaf4a

Browse files
Apply suggestions from code review
Co-authored-by: Iwao AVE! <[email protected]>
1 parent 5eab49e commit 1fcaf4a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/site/markdown/sqlmap-xml.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ The `resultMap` element has a number of sub-elements and a structure worthy of s
570570
- `result` – a normal result injected into a field or JavaBean property
571571
- `association` – a complex type association; many results will roll up into this type
572572
- nested result mappings – associations are `resultMap`s themselves, or can refer to one
573-
- collection – a collection of complex types
573+
- `collection` – a collection of complex types
574574
- nested result mappings – collections are `resultMap`s themselves, or can refer to one
575575
- `discriminator` – uses a result value to determine which `resultMap` to use
576576
- `case` – a case is a result map based on some value
@@ -647,7 +647,7 @@ In order to inject the results into the constructor, MyBatis needs to identify t
647647
</constructor>
648648
```
649649

650-
When you are dealing with a constructor with many parameters, maintaining the order of arg elements is error-prone.
650+
When you are dealing with a constructor with many parameters, maintaining the order of arg elements is error-prone.
651651
Since 3.4.3, by specifying the name of each parameter, you can write arg elements in any order. To reference constructor parameters by their names, you can either add `@Param` annotation to them or compile the project with '-parameters' compiler option and enable `useActualParamName` (this option is enabled by default). The following example is valid for the same constructor even though the order of the second and the third parameters does not match with the declared order.
652652

653653
```xml
@@ -1137,6 +1137,9 @@ Auto-mapping works even when there is an specific result map. When this happens,
11371137
from some_table
11381138
where id = #{id}
11391139
</select>
1140+
```
1141+
1142+
```xml
11401143
<resultMap id="userResultMap" type="User">
11411144
<result property="password" column="hashed_password"/>
11421145
</resultMap>
@@ -1159,6 +1162,9 @@ The default value is `PARTIAL`, and it is so for a reason. When `FULL` is used a
11591162
from Blog B left outer join Author A on B.author_id = A.id
11601163
where B.id = #{id}
11611164
</select>
1165+
```
1166+
1167+
```xml
11621168
<resultMap id="blogResult" type="Blog">
11631169
<association property="author" resultMap="authorResult"/>
11641170
</resultMap>
@@ -1258,7 +1264,7 @@ To configure your cache, simply add public JavaBeans properties to your Cache im
12581264
</cache>
12591265
```
12601266

1261-
You can use JavaBeans properties of all simple types, MyBatis will do the conversion. And you can specify a placeholder(e.g. `\${cache.file}`) to replace value defined at [configuration properties](https://mybatis.org/mybatis-3/configuration.html#properties).
1267+
You can use JavaBeans properties of all simple types, MyBatis will do the conversion. And you can specify a placeholder(e.g. `\${cache.file}`) to replace value defined at [configuration properties](configuration.html#properties).
12621268

12631269
Since 3.4.2, the MyBatis has been supported to call an initialization method after it's set all properties. If you want to use this feature, please implements the `org.apache.ibatis.builder.InitializingObject` interface on your custom cache class.
12641270

0 commit comments

Comments
 (0)