50,530
社区成员
发帖
与我相关
我的任务
分享
<sqlMap>
<typeAlias alias="cstuff" type="com.ttzn.model.StuffClass"/>
<resultMap class="cstuff" id="cstuff">
<result property="cstuffCode" column="cstuff_code"/>
<result property="cstuffName" column="cstuff_name"/>
<result property="cstuffProtected" column="cstuff_protected"/>
<result property="cstuffType" column="cstuff_type"/>
</resultMap>
<select id="findAll" resultClass="cstuff">
<![CDATA[
select *
from stuffclass
]]>
</select>
</sqlMap>
public List<StuffClass> findAll() {
List<StuffClass> list = null;
try {
list = client.queryForList("findAll");
System.out.println("list size::"+list.size());//这里输出6
System.out.println("name::"+list.get(0).getCstuffName());//这里输出null
} catch (SQLException e) {
e.printStackTrace();
}
return list;
}