Skip to content

Commit 042c106

Browse files
committed
More parameterType removals and minor fix in the SP doc [ci skip]
1 parent 23814c6 commit 042c106

File tree

5 files changed

+45
-45
lines changed

5 files changed

+45
-45
lines changed

src/site/es/xdoc/sqlmap-xml.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -728,13 +728,13 @@ public class User {
728728
<td>Un identificador único dentro del namespace que se utiliza para identificar el result map.</td>
729729
</tr>
730730
<tr>
731-
<td><code>parameterType</code></td>
731+
<td><code>type</code></td>
732732
<td>El nombre completamente cualificado de la clase o el alias del parámetro que se pasará al statement.</td>
733733
</tr>
734734
<tr>
735735
<td><code>autoMapping</code></td>
736736
<td>Si el atributo está presente MyBatis habilita o inhabilita el automapping para este result map.
737-
El atributo sobreescribe el parametro global autoMappingBehavior.
737+
El atributo sobreescribe el parametro global autoMappingBehavior. Valor por defecto: no informado.
738738
</td>
739739
</tr>
740740
</tbody>
@@ -1006,11 +1006,11 @@ public class User {
10061006
<association property="author" column="author_id" javaType="Author" select="selectAuthor"/>
10071007
</resultMap>
10081008
1009-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1009+
<select id="selectBlog" resultMap="blogResult">
10101010
SELECT * FROM BLOG WHERE ID = #{id}
10111011
</select>
10121012
1013-
<select id="selectAuthor" parameterType="int" resultType="Author">
1013+
<select id="selectAuthor" resultType="Author">
10141014
SELECT * FROM AUTHOR WHERE ID = #{id}
10151015
</select>]]></source>
10161016

@@ -1081,7 +1081,7 @@ public class User {
10811081
<p>Previamente has visto un ejemplo muy complejo de asociaciones anidadas. Lo que se muestra a continuación es un ejemplo más simple que muestra cómo funciona esta característica. En lugar de ejecutar un statement separado, vamos a hacer una JOIN de las tablas Blog y Author de la siguiente forma:
10821082
</p>
10831083

1084-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1084+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
10851085
select
10861086
B.id as blog_id,
10871087
B.title as blog_title,
@@ -1138,7 +1138,7 @@ public class User {
11381138
Pero ¿y si el blog tiene un co-autor? La select sería algo así:
11391139
</p>
11401140

1141-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1141+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
11421142
select
11431143
B.id as blog_id,
11441144
B.title as blog_title,
@@ -1286,11 +1286,11 @@ SELECT * FROM AUTHOR WHERE ID = #{id}]]></source>
12861286
<collection property="posts" javaType="ArrayList" column="id" ofType="Post" select="selectPostsForBlog"/>
12871287
</resultMap>
12881288
1289-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1289+
<select id="selectBlog" resultMap="blogResult">
12901290
SELECT * FROM BLOG WHERE ID = #{id}
12911291
</select>
12921292
1293-
<select id="selectPostsForBlog" parameterType="int" resultType="Post">
1293+
<select id="selectPostsForBlog" resultType="Post">
12941294
SELECT * FROM POST WHERE BLOG_ID = #{id}
12951295
</select>]]></source>
12961296

@@ -1315,7 +1315,7 @@ SELECT * FROM AUTHOR WHERE ID = #{id}]]></source>
13151315

13161316
<p>Primero, echemos un vistazo al SQL:</p>
13171317

1318-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1318+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
13191319
select
13201320
B.id as blog_id,
13211321
B.title as blog_title,
@@ -1372,7 +1372,7 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
13721372
<p>Se debe proporcionar un nombre a cada resultset informando el atributo
13731373
<code>resultSets</code> del mapped statement con una lista de nombres separados por comas.</p>
13741374

1375-
<source><![CDATA[<select id="selectBlog" resultSets="blogs,posts" parameterType="int" resultMap="blogResult">
1375+
<source><![CDATA[<select id="selectBlog" resultSets="blogs,posts" resultMap="blogResult">
13761376
{call getBlogsAndPosts(#{id,jdbcType=INTEGER,mode=IN})}
13771377
</select>]]></source>
13781378

@@ -1532,7 +1532,7 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
15321532
por lo tanto podrían producirse mapeos automáticos indeseados. Para comprender el riesgo observa el siguiente ejemplo:
15331533
</p>
15341534

1535-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1535+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
15361536
select
15371537
B.id,
15381538
B.title,

src/site/ja/xdoc/sqlmap-xml.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,11 +1182,11 @@ public class User {
11821182
<association property="author" column="author_id" javaType="Author" select="selectAuthor"/>
11831183
</resultMap>
11841184
1185-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1185+
<select id="selectBlog" resultMap="blogResult">
11861186
SELECT * FROM BLOG WHERE ID = #{id}
11871187
</select>
11881188
1189-
<select id="selectAuthor" parameterType="int" resultType="Author">
1189+
<select id="selectAuthor" resultType="Author">
11901190
SELECT * FROM AUTHOR WHERE ID = #{id}
11911191
</select>]]></source>
11921192

@@ -1268,7 +1268,7 @@ public class User {
12681268
ネストされたアソシエーションについては、既にとても複雑な例を見ていただきました。次のサンプルは、それと比べるとずっと理解しやすいと思います。ここでは、独立した select を実行する代わりに Blog と Author のテーブルを結合するクエリを実行します。
12691269
</p>
12701270

1271-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1271+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
12721272
select
12731273
B.id as blog_id,
12741274
B.title as blog_title,
@@ -1330,7 +1330,7 @@ public class User {
13301330
select ステートメントは下記のようになります。
13311331
</p>
13321332

1333-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1333+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
13341334
select
13351335
B.id as blog_id,
13361336
B.title as blog_title,
@@ -1473,11 +1473,11 @@ SELECT * FROM AUTHOR WHERE ID = #{id}]]></source>
14731473
<collection property="posts" javaType="ArrayList" column="id" ofType="Post" select="selectPostsForBlog"/>
14741474
</resultMap>
14751475
1476-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1476+
<select id="selectBlog" resultMap="blogResult">
14771477
SELECT * FROM BLOG WHERE ID = #{id}
14781478
</select>
14791479
1480-
<select id="selectPostsForBlog" parameterType="int" resultType="Blog">
1480+
<select id="selectPostsForBlog" resultType="Blog">
14811481
SELECT * FROM POST WHERE BLOG_ID = #{id}
14821482
</select>]]></source>
14831483

@@ -1510,7 +1510,7 @@ SELECT * FROM AUTHOR WHERE ID = #{id}]]></source>
15101510

15111511
<p>まずは SQL を見てみましょう。</p>
15121512

1513-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1513+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
15141514
select
15151515
B.id as blog_id,
15161516
B.title as blog_title,
@@ -1569,7 +1569,7 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
15691569

15701570
<p>ストアドプロシージャを実行する select 要素の <code>resultSets</code> 属性で、それぞれの ResultSet に名前を付けておく必要があります(カンマ区切り)。ここでは、それぞれ blogs, posts としています。</p>
15711571

1572-
<source><![CDATA[<select id="selectBlog" resultSets="blogs,posts" parameterType="int" resultMap="blogResult">
1572+
<source><![CDATA[<select id="selectBlog" resultSets="blogs,posts" resultMap="blogResult">
15731573
{call getBlogsAndPosts(#{id,jdbcType=INTEGER,mode=IN})}
15741574
</select>]]></source>
15751575

@@ -1755,7 +1755,7 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
17551755
次の例を見てください。
17561756
</p>
17571757

1758-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1758+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
17591759
select
17601760
B.id,
17611761
B.title,

src/site/ko/xdoc/sqlmap-xml.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -982,11 +982,11 @@ prop1, prop2 형태로 셋팅하게 될 것이다.</td>
982982
<association property="author" column="author_id" javaType="Author" select="selectAuthor"/>
983983
</resultMap>
984984
985-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
985+
<select id="selectBlog" resultMap="blogResult">
986986
SELECT * FROM BLOG WHERE ID = #{id}
987987
</select>
988988
989-
<select id="selectAuthor" parameterType="int" resultType="Author">
989+
<select id="selectAuthor" resultType="Author">
990990
SELECT * FROM AUTHOR WHERE ID = #{id}
991991
</select>]]></source>
992992

@@ -1057,7 +1057,7 @@ prop1, prop2 형태로 셋팅하게 될 것이다.</td>
10571057
<p>위에서 내포된 관계의 매우 복잡한 예제를 보았을 것이다. 다음은 작동하는 것을 보기 위한 좀더 간단한 예제이다. 개별
10581058
구문을 실행하는 것 대신에, Blog 와 Author 테이블을 함께 조인했다.</p>
10591059

1060-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1060+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
10611061
select
10621062
B.id as blog_id,
10631063
B.title as blog_title,
@@ -1116,7 +1116,7 @@ association 결과 매핑을 내포시킬수 있다. 다음은 이 방법을 사
11161116
The select statement would look like:
11171117
</p>
11181118

1119-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1119+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
11201120
select
11211121
B.id as blog_id,
11221122
B.title as blog_title,
@@ -1191,11 +1191,11 @@ association 결과 매핑을 내포시킬수 있다. 다음은 이 방법을 사
11911191
<collection property="posts" javaType="ArrayList" column="id" ofType="Post" select="selectPostsForBlog"/>
11921192
</resultMap>
11931193
1194-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1194+
<select id="selectBlog" resultMap="blogResult">
11951195
SELECT * FROM BLOG WHERE ID = #{id}
11961196
</select>
11971197
1198-
<select id="selectPostsForBlog" parameterType="int" resultType="Blog">
1198+
<select id="selectPostsForBlog" resultType="Blog">
11991199
SELECT * FROM POST WHERE BLOG_ID = #{id}
12001200
</select>]]></source>
12011201

@@ -1221,7 +1221,7 @@ collection 의 타입을 구분하기 위해 필요하다.</p>
12211221

12221222
<p>먼저, SQL 을 보자.</p>
12231223

1224-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1224+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
12251225
select
12261226
B.id as blog_id,
12271227
B.title as blog_title,
@@ -1407,7 +1407,7 @@ vehicle 간의 관계를 알 수 있다. 그러므로, 나머지 프로퍼티들
14071407
hence this may result in undesired mappings. To understand the risk have a look at the following sample:
14081408
</p>
14091409

1410-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1410+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
14111411
select
14121412
B.id,
14131413
B.title,

src/site/xdoc/sqlmap-xml.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,11 +1282,11 @@ public class User {
12821282
<association property="author" column="author_id" javaType="Author" select="selectAuthor"/>
12831283
</resultMap>
12841284
1285-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1285+
<select id="selectBlog" resultMap="blogResult">
12861286
SELECT * FROM BLOG WHERE ID = #{id}
12871287
</select>
12881288
1289-
<select id="selectAuthor" parameterType="int" resultType="Author">
1289+
<select id="selectAuthor" resultType="Author">
12901290
SELECT * FROM AUTHOR WHERE ID = #{id}
12911291
</select>]]></source>
12921292

@@ -1382,7 +1382,7 @@ public class User {
13821382
the Blog and Author tables together, like so:
13831383
</p>
13841384

1385-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1385+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
13861386
select
13871387
B.id as blog_id,
13881388
B.title as blog_title,
@@ -1453,7 +1453,7 @@ public class User {
14531453
The select statement would look like:
14541454
</p>
14551455

1456-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1456+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
14571457
select
14581458
B.id as blog_id,
14591459
B.title as blog_title,
@@ -1610,11 +1610,11 @@ SELECT * FROM AUTHOR WHERE ID = #{id}]]></source>
16101610
<collection property="posts" javaType="ArrayList" column="id" ofType="Post" select="selectPostsForBlog"/>
16111611
</resultMap>
16121612
1613-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1613+
<select id="selectBlog" resultMap="blogResult">
16141614
SELECT * FROM BLOG WHERE ID = #{id}
16151615
</select>
16161616
1617-
<select id="selectPostsForBlog" parameterType="int" resultType="Post">
1617+
<select id="selectPostsForBlog" resultType="Post">
16181618
SELECT * FROM POST WHERE BLOG_ID = #{id}
16191619
</select>]]></source>
16201620

@@ -1648,7 +1648,7 @@ SELECT * FROM AUTHOR WHERE ID = #{id}]]></source>
16481648

16491649
<p>First, let's look at the SQL:</p>
16501650

1651-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1651+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
16521652
select
16531653
B.id as blog_id,
16541654
B.title as blog_title,
@@ -1711,7 +1711,7 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
17111711
<p>A name must be given to each result set by adding a
17121712
<code>resultSets</code> attribute to the mapped statement with a list of names separated by commas.</p>
17131713

1714-
<source><![CDATA[<select id="selectBlog" resultSets="blogs,posts" parameterType="int" resultMap="blogResult">
1714+
<source><![CDATA[<select id="selectBlog" resultSets="blogs,posts" resultMap="blogResult">
17151715
{call getBlogsAndPosts(#{id,jdbcType=INTEGER,mode=IN})}
17161716
</select>]]></source>
17171717

@@ -1902,7 +1902,7 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
19021902
hence this may result in undesired mappings. To understand the risk have a look at the following sample:
19031903
</p>
19041904

1905-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1905+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
19061906
select
19071907
B.id,
19081908
B.title,

src/site/zh/xdoc/sqlmap-xml.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,11 +1328,11 @@ prop1 和 prop2 以参数对象形式来设置给目标嵌套查询语句。
13281328
<association property="author" column="author_id" javaType="Author" select="selectAuthor"/>
13291329
</resultMap>
13301330
1331-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1331+
<select id="selectBlog" resultMap="blogResult">
13321332
SELECT * FROM BLOG WHERE ID = #{id}
13331333
</select>
13341334
1335-
<select id="selectAuthor" parameterType="int" resultType="Author">
1335+
<select id="selectAuthor" resultType="Author">
13361336
SELECT * FROM AUTHOR WHERE ID = #{id}
13371337
</select>]]></source>
13381338

@@ -1427,7 +1427,7 @@ resultMap
14271427
来说明它如何工作。代替了执行一个分离的语句,我们联合博客表和作者表在一起,就像:
14281428
</p>
14291429

1430-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1430+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
14311431
select
14321432
B.id as blog_id,
14331433
B.title as blog_title,
@@ -1495,7 +1495,7 @@ resultMap
14951495
The select statement would look like:
14961496
</p>
14971497

1498-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1498+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
14991499
select
15001500
B.id as blog_id,
15011501
B.title as blog_title,
@@ -1582,11 +1582,11 @@ resultMap
15821582
<collection property="posts" javaType="ArrayList" column="id" ofType="Post" select="selectPostsForBlog"/>
15831583
</resultMap>
15841584
1585-
<select id="selectBlog" parameterType="int" resultMap="blogResult">
1585+
<select id="selectBlog" resultMap="blogResult">
15861586
SELECT * FROM BLOG WHERE ID = #{id}
15871587
</select>
15881588
1589-
<select id="selectPostsForBlog" parameterType="int" resultType="Blog">
1589+
<select id="selectPostsForBlog" resultType="Blog">
15901590
SELECT * FROM POST WHERE BLOG_ID = #{id}
15911591
</select>]]></source>
15921592

@@ -1619,7 +1619,7 @@ javaType 属性是不需要的,因为 MyBatis 在很多情况下会为你算出
16191619

16201620
<p>First, let's look at the SQL:</p>
16211621

1622-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1622+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
16231623
select
16241624
B.id as blog_id,
16251625
B.title as blog_title,
@@ -1849,7 +1849,7 @@ MyBatis 会从结果集中得到每条记录,
18491849
hence this may result in undesired mappings. To understand the risk have a look at the following sample:
18501850
</p>
18511851

1852-
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
1852+
<source><![CDATA[<select id="selectBlog" resultMap="blogResult">
18531853
select
18541854
B.id,
18551855
B.title,

0 commit comments

Comments
 (0)