您的位置:首页 > 其它

关于mybatis配置文件中的resultMap和resultType

2017-08-27 20:27 387 查看
<select id="selectByName" parameterType="string" resultType ="com.listore.pojo.Category">
select * from listore_category where name = #{name,jdbcType=VARCHAR};
</select>

在没有<include>标签中可以使用resultType,但是有了<include>标签以后就会封装对象时候封装失败

比如:

<select id="selectByProductIdUserId" parameterType="map" resultType="com.listore.pojo.Cart">
select
<include refid="Base_Column_List"/>
from listore_cart
where user_id=#{userId}
and product_id=#{productId}
</select>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  SSM框架
相关文章推荐