Skip to content

Commit c2d5254

Browse files
committed
Add test that demonstrates issue with FastResultSetHandler
1 parent 4c2cbe9 commit c2d5254

File tree

6 files changed

+453
-0
lines changed

6 files changed

+453
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
package org.apache.ibatis.submitted.awful_table;
2+
3+
public class AwfulTable {
4+
private Integer customerId;
5+
private String firstFirstName;
6+
private String secondFirstName;
7+
private String thirdFirstName;
8+
private String lastName;
9+
private String eMail;
10+
private Integer id1;
11+
private Integer id2;
12+
private Integer id5;
13+
private Integer id6;
14+
private Integer id7;
15+
private String emailaddress;
16+
private String from;
17+
private boolean active;
18+
public Integer getCustomerId() {
19+
return customerId;
20+
}
21+
public void setCustomerId(Integer customerId) {
22+
this.customerId = customerId;
23+
}
24+
public String getFirstFirstName() {
25+
return firstFirstName;
26+
}
27+
public void setFirstFirstName(String firstFirstName) {
28+
this.firstFirstName = firstFirstName;
29+
}
30+
public String getSecondFirstName() {
31+
return secondFirstName;
32+
}
33+
public void setSecondFirstName(String secondFirstName) {
34+
this.secondFirstName = secondFirstName;
35+
}
36+
public String getThirdFirstName() {
37+
return thirdFirstName;
38+
}
39+
public void setThirdFirstName(String thirdFirstName) {
40+
this.thirdFirstName = thirdFirstName;
41+
}
42+
public String getLastName() {
43+
return lastName;
44+
}
45+
public void setLastName(String lastName) {
46+
this.lastName = lastName;
47+
}
48+
public String geteMail() {
49+
return eMail;
50+
}
51+
public void seteMail(String eMail) {
52+
this.eMail = eMail;
53+
}
54+
public Integer getId1() {
55+
return id1;
56+
}
57+
public void setId1(Integer id1) {
58+
this.id1 = id1;
59+
}
60+
public Integer getId2() {
61+
return id2;
62+
}
63+
public void setId2(Integer id2) {
64+
this.id2 = id2;
65+
}
66+
public Integer getId5() {
67+
return id5;
68+
}
69+
public void setId5(Integer id5) {
70+
this.id5 = id5;
71+
}
72+
public Integer getId6() {
73+
return id6;
74+
}
75+
public void setId6(Integer id6) {
76+
this.id6 = id6;
77+
}
78+
public Integer getId7() {
79+
return id7;
80+
}
81+
public void setId7(Integer id7) {
82+
this.id7 = id7;
83+
}
84+
public String getEmailaddress() {
85+
return emailaddress;
86+
}
87+
public void setEmailaddress(String emailaddress) {
88+
this.emailaddress = emailaddress;
89+
}
90+
public String getFrom() {
91+
return from;
92+
}
93+
public void setFrom(String from) {
94+
this.from = from;
95+
}
96+
public boolean isActive() {
97+
return active;
98+
}
99+
public void setActive(boolean active) {
100+
this.active = active;
101+
}
102+
103+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.apache.ibatis.submitted.awful_table;
2+
3+
public interface AwfulTableMapper {
4+
5+
int deleteByPrimaryKey(Integer customerId);
6+
7+
int insert(AwfulTable record);
8+
9+
int insertSelective(AwfulTable record);
10+
11+
AwfulTable selectByPrimaryKey(Integer customerId);
12+
13+
int updateByPrimaryKeySelective(AwfulTable record);
14+
15+
int updateByPrimaryKey(AwfulTable record);
16+
}
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3+
<mapper namespace="org.apache.ibatis.submitted.awful_table.AwfulTableMapper" >
4+
<resultMap id="BaseResultMap" type="org.apache.ibatis.submitted.awful_table.AwfulTable" >
5+
<id column="A_CuStOmEr iD" property="customerId" jdbcType="INTEGER" />
6+
<result column="A_first name" property="firstFirstName" jdbcType="VARCHAR" />
7+
<result column="A_FIRST_NAME" property="secondFirstName" jdbcType="VARCHAR" />
8+
<result column="A_FIRSTNAME" property="thirdFirstName" jdbcType="VARCHAR" />
9+
<result column="A_last name" property="lastName" jdbcType="VARCHAR" />
10+
<result column="A_E_MAIL" property="eMail" jdbcType="VARCHAR" />
11+
<result column="A__id1" property="id1" jdbcType="INTEGER" />
12+
<result column="A_$id2" property="id2" jdbcType="INTEGER" />
13+
<result column="A_id5_" property="id5" jdbcType="INTEGER" />
14+
<result column="A_id6$" property="id6" jdbcType="INTEGER" />
15+
<result column="A_id7$$" property="id7" jdbcType="INTEGER" />
16+
<result column="A_EMAILADDRESS" property="emailaddress" jdbcType="VARCHAR" />
17+
<result column="A_from" property="from" jdbcType="VARCHAR" />
18+
<result column="A_ACTIVE" property="active" jdbcType="BIT" />
19+
</resultMap>
20+
<sql id="Base_Column_List" >
21+
A."CuStOmEr iD" as "A_CuStOmEr iD", A."first name" as "A_first name", A.FIRST_NAME as A_FIRST_NAME,
22+
A.FIRSTNAME as A_FIRSTNAME, A."last name" as "A_last name", A.E_MAIL as A_E_MAIL,
23+
A."_id1" as "A__id1", A."$id2" as "A_$id2", A."id5_" as "A_id5_", A."id6$" as "A_id6$",
24+
A."id7$$" as "A_id7$$", A.EMAILADDRESS as A_EMAILADDRESS, A."from" as "A_from", A.ACTIVE as A_ACTIVE
25+
</sql>
26+
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
27+
select
28+
<include refid="Base_Column_List" />
29+
from "awful table" A
30+
where A."CuStOmEr iD" = #{customerId,jdbcType=INTEGER}
31+
</select>
32+
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
33+
delete from "awful table"
34+
where "CuStOmEr iD" = #{customerId,jdbcType=INTEGER}
35+
</delete>
36+
<insert id="insert" parameterType="org.apache.ibatis.submitted.awful_table.AwfulTable" useGeneratedKeys="true" keyProperty="customerId" >
37+
insert into "awful table" ("first name", FIRST_NAME,
38+
FIRSTNAME, "last name", E_MAIL,
39+
"_id1", "$id2", "id5_", "id6$",
40+
"id7$$", EMAILADDRESS, "from",
41+
ACTIVE)
42+
values (#{firstFirstName,jdbcType=VARCHAR}, #{secondFirstName,jdbcType=VARCHAR},
43+
#{thirdFirstName,jdbcType=VARCHAR}, #{lastName,jdbcType=VARCHAR}, #{eMail,jdbcType=VARCHAR},
44+
#{id1,jdbcType=INTEGER}, #{id2,jdbcType=INTEGER}, #{id5,jdbcType=INTEGER}, #{id6,jdbcType=INTEGER},
45+
#{id7,jdbcType=INTEGER}, #{emailaddress,jdbcType=VARCHAR}, #{from,jdbcType=VARCHAR},
46+
#{active,jdbcType=BIT})
47+
</insert>
48+
<insert id="insertSelective" parameterType="org.apache.ibatis.submitted.awful_table.AwfulTable" useGeneratedKeys="true" keyProperty="customerId" >
49+
insert into "awful table"
50+
<trim prefix="(" suffix=")" suffixOverrides="," >
51+
<if test="firstFirstName != null" >
52+
"first name",
53+
</if>
54+
<if test="secondFirstName != null" >
55+
FIRST_NAME,
56+
</if>
57+
<if test="thirdFirstName != null" >
58+
FIRSTNAME,
59+
</if>
60+
<if test="lastName != null" >
61+
"last name",
62+
</if>
63+
<if test="eMail != null" >
64+
E_MAIL,
65+
</if>
66+
<if test="id1 != null" >
67+
"_id1",
68+
</if>
69+
<if test="id2 != null" >
70+
"$id2",
71+
</if>
72+
<if test="id5 != null" >
73+
"id5_",
74+
</if>
75+
<if test="id6 != null" >
76+
"id6$",
77+
</if>
78+
<if test="id7 != null" >
79+
"id7$$",
80+
</if>
81+
<if test="emailaddress != null" >
82+
EMAILADDRESS,
83+
</if>
84+
<if test="from != null" >
85+
"from",
86+
</if>
87+
ACTIVE,
88+
</trim>
89+
<trim prefix="values (" suffix=")" suffixOverrides="," >
90+
<if test="firstFirstName != null" >
91+
#{firstFirstName,jdbcType=VARCHAR},
92+
</if>
93+
<if test="secondFirstName != null" >
94+
#{secondFirstName,jdbcType=VARCHAR},
95+
</if>
96+
<if test="thirdFirstName != null" >
97+
#{thirdFirstName,jdbcType=VARCHAR},
98+
</if>
99+
<if test="lastName != null" >
100+
#{lastName,jdbcType=VARCHAR},
101+
</if>
102+
<if test="eMail != null" >
103+
#{eMail,jdbcType=VARCHAR},
104+
</if>
105+
<if test="id1 != null" >
106+
#{id1,jdbcType=INTEGER},
107+
</if>
108+
<if test="id2 != null" >
109+
#{id2,jdbcType=INTEGER},
110+
</if>
111+
<if test="id5 != null" >
112+
#{id5,jdbcType=INTEGER},
113+
</if>
114+
<if test="id6 != null" >
115+
#{id6,jdbcType=INTEGER},
116+
</if>
117+
<if test="id7 != null" >
118+
#{id7,jdbcType=INTEGER},
119+
</if>
120+
<if test="emailaddress != null" >
121+
#{emailaddress,jdbcType=VARCHAR},
122+
</if>
123+
<if test="from != null" >
124+
#{from,jdbcType=VARCHAR},
125+
</if>
126+
#{active,jdbcType=BIT},
127+
</trim>
128+
</insert>
129+
<update id="updateByPrimaryKeySelective" parameterType="org.apache.ibatis.submitted.awful_table.AwfulTable" >
130+
update "awful table"
131+
<set >
132+
<if test="firstFirstName != null" >
133+
"first name" = #{firstFirstName,jdbcType=VARCHAR},
134+
</if>
135+
<if test="secondFirstName != null" >
136+
FIRST_NAME = #{secondFirstName,jdbcType=VARCHAR},
137+
</if>
138+
<if test="thirdFirstName != null" >
139+
FIRSTNAME = #{thirdFirstName,jdbcType=VARCHAR},
140+
</if>
141+
<if test="lastName != null" >
142+
"last name" = #{lastName,jdbcType=VARCHAR},
143+
</if>
144+
<if test="eMail != null" >
145+
E_MAIL = #{eMail,jdbcType=VARCHAR},
146+
</if>
147+
<if test="id1 != null" >
148+
"_id1" = #{id1,jdbcType=INTEGER},
149+
</if>
150+
<if test="id2 != null" >
151+
"$id2" = #{id2,jdbcType=INTEGER},
152+
</if>
153+
<if test="id5 != null" >
154+
"id5_" = #{id5,jdbcType=INTEGER},
155+
</if>
156+
<if test="id6 != null" >
157+
"id6$" = #{id6,jdbcType=INTEGER},
158+
</if>
159+
<if test="id7 != null" >
160+
"id7$$" = #{id7,jdbcType=INTEGER},
161+
</if>
162+
<if test="emailaddress != null" >
163+
EMAILADDRESS = #{emailaddress,jdbcType=VARCHAR},
164+
</if>
165+
<if test="from != null" >
166+
"from" = #{from,jdbcType=VARCHAR},
167+
</if>
168+
<if test="active != null" >
169+
ACTIVE = #{active,jdbcType=BIT},
170+
</if>
171+
</set>
172+
where "CuStOmEr iD" = #{customerId,jdbcType=INTEGER}
173+
</update>
174+
<update id="updateByPrimaryKey" parameterType="org.apache.ibatis.submitted.awful_table.AwfulTable" >
175+
update "awful table"
176+
set "first name" = #{firstFirstName,jdbcType=VARCHAR},
177+
FIRST_NAME = #{secondFirstName,jdbcType=VARCHAR},
178+
FIRSTNAME = #{thirdFirstName,jdbcType=VARCHAR},
179+
"last name" = #{lastName,jdbcType=VARCHAR},
180+
E_MAIL = #{eMail,jdbcType=VARCHAR},
181+
"_id1" = #{id1,jdbcType=INTEGER},
182+
"$id2" = #{id2,jdbcType=INTEGER},
183+
"id5_" = #{id5,jdbcType=INTEGER},
184+
"id6$" = #{id6,jdbcType=INTEGER},
185+
"id7$$" = #{id7,jdbcType=INTEGER},
186+
EMAILADDRESS = #{emailaddress,jdbcType=VARCHAR},
187+
"from" = #{from,jdbcType=VARCHAR},
188+
ACTIVE = #{active,jdbcType=BIT}
189+
where "CuStOmEr iD" = #{customerId,jdbcType=INTEGER}
190+
</update>
191+
</mapper>

0 commit comments

Comments
 (0)