Skip to content

Commit 15d27ba

Browse files
committed
1 parent 621a30d commit 15d27ba

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

src/test/java/domain/blog/PostLiteId.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@
1616
package domain.blog;
1717

1818
public class PostLiteId {
19-
private final int id;
19+
private int id;
20+
21+
public PostLiteId() {
22+
23+
}
24+
25+
public void setId(int id) {
26+
this.id = id;
27+
}
2028

2129
public PostLiteId(int aId) {
2230
id = aId;

src/test/java/org/apache/ibatis/builder/PostMapper.xml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,20 @@
3737

3838
<resultMap id="mutablePostLiteMap" type="domain.blog.PostLite">
3939
<result property="blogId" column="blog_id"/>
40-
<association property="id" column="id" resultMap="postLiteIdMap"/>
40+
<association property="id" column="id" resultMap="mutablePostLiteIdMap"/>
4141
</resultMap>
4242

43-
<select id="selectPostLite" resultMap="postLiteMap">
44-
select id, blog_id from post where blog_id is not null
45-
</select>
43+
<resultMap id="mutablePostLiteIdMap" type="domain.blog.PostLiteId">
44+
<id property="id" column="id"/>
45+
</resultMap>
46+
47+
<select id="selectPostLite" resultMap="postLiteMap">
48+
select id, blog_id from post where blog_id is not null
49+
</select>
4650

47-
<select id="selectMutablePostLite" resultMap="mutablePostLiteMap">
48-
select id, blog_id from post where blog_id is not null
49-
</select>
51+
<select id="selectMutablePostLite" resultMap="mutablePostLiteMap">
52+
select id, blog_id from post where blog_id is not null
53+
</select>
5054

5155
<sql id="byBlogId">
5256
<if test="blog_id != null">blog_id = #{blog_id}</if>

0 commit comments

Comments
 (0)