You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,7 +60,7 @@ Multiple tables can be joined in a single statement. For example:
60
60
.build()
61
61
.render(RenderingStrategy.MYBATIS3);
62
62
```
63
-
Join queries will likely require you to define a MyBatis result mapping in XML. This is the only instance where XML is required. This is due to the limitations of the MyBatis annotations when mapping collections.
63
+
Join queries will likely require you to define a MyBatis result mapping in XML. This is the only instance where XML is required. This is due to the limitations of the MyBatis annotations when mapping collections.
64
64
65
65
The library supports four join types:
66
66
@@ -70,7 +70,7 @@ The library supports four join types:
70
70
4.`.fullJoin(...)` is a FULL OUTER join
71
71
72
72
## Union Queries
73
-
The library supports the generation of UNION and UNION ALL queries. For example:
73
+
The library supports the generation of UNION and UNION ALL queries. For example:
@@ -83,11 +83,11 @@ The library supports the generation of UNION and UNION ALL queries. For example
83
83
.render(RenderingStrategy.MYBATIS3);
84
84
```
85
85
86
-
Any number of SELECT statements can be added to a UNION query. Only one ORDER BY phrase is allowed.
86
+
Any number of SELECT statements can be added to a UNION query. Only one ORDER BY phrase is allowed.
87
87
88
88
## Annotated Mapper for Select Statements
89
89
90
-
The SelectStatementProvider object can be used as a parameter to a MyBatis mapper method directly. If you
90
+
The SelectStatementProvider object can be used as a parameter to a MyBatis mapper method directly. If you
91
91
are using an annotated mapper, the select method should look like this (note that we recommend coding a "selectMany" and a "selectOne" method with a shared result mapping):
If you are coding a join, it is likely you will need to code an XML mapper to define the result map. This is due to a MyBatis limitation - the annotations cannot define a collection mapping. If you have to do this, the Java code looks like this:
120
+
If you are coding a join, it is likely you will need to code an XML mapper to define the result map. This is due to a MyBatis limitation - the annotations cannot define a collection mapping. If you have to do this, the Java code looks like this:
@@ -142,7 +142,7 @@ And the corresponding XML looks like this:
142
142
</mapper>
143
143
```
144
144
145
-
Notice that the resultMap is the only element in the XML mapper. This is our recommended practice.
145
+
Notice that the resultMap is the only element in the XML mapper. This is our recommended practice.
146
146
147
147
## XML Mapper for Select Statements
148
148
We do not recommend using an XML mapper for select statements, but if you want to do so the SelectStatementProvider object can be used as a parameter to a MyBatis mapper method directly.
0 commit comments