ibatis中resultMap和resultClass的区别 以及parameterClass 的取值
1个回答
展开全部
resultMap和resultClass指的是在 select查询中的返回数据类型
resultMap取值
一、resultMap必须和我们之前定义<resultMap id="accountMerchantDistribution"的Id相同
<resultMap id="accountMerchantDistribution" class="com.sfbest.bean.AccountMerchantDistribution" >
<result column="id" property="id" jdbcType="int" />
<result column="merchant_number" property="merchantNumber" jdbcType="int" />
<result column="province" property="province" jdbcType="int" />
<result column="city" property="city" jdbcType="int" />
<result column="county" property="county" jdbcType="int" />
<result column="distribute_times" property="distributeTimes" jdbcType="int" />
<result column="pay_cash" property="payCash" jdbcType="int" />
</resultMap>
<resultMap id="accountMerchantDistribution" class="com.sfbest.bean.AccountMerchantDistribution" >
</resultMap> 重复使用占有优势
二、resultClass取值
1.resultClass="int"
2.resultClass="com.sfbest.product.bean.ProductPicture"
3.resultClass="string"
4.resultClass="long"
5.resultClass="Java.util.HashMap"
三、parameterClass指的是select save update delete SQL语句的where执行条件
parameterClass可以的取值
1、parameterClass="int"
2、parameterClass="map"
3、parameterClass="com.sfbest.bean.AccountMerchantDistribution"
resultMap取值
一、resultMap必须和我们之前定义<resultMap id="accountMerchantDistribution"的Id相同
<resultMap id="accountMerchantDistribution" class="com.sfbest.bean.AccountMerchantDistribution" >
<result column="id" property="id" jdbcType="int" />
<result column="merchant_number" property="merchantNumber" jdbcType="int" />
<result column="province" property="province" jdbcType="int" />
<result column="city" property="city" jdbcType="int" />
<result column="county" property="county" jdbcType="int" />
<result column="distribute_times" property="distributeTimes" jdbcType="int" />
<result column="pay_cash" property="payCash" jdbcType="int" />
</resultMap>
<resultMap id="accountMerchantDistribution" class="com.sfbest.bean.AccountMerchantDistribution" >
</resultMap> 重复使用占有优势
二、resultClass取值
1.resultClass="int"
2.resultClass="com.sfbest.product.bean.ProductPicture"
3.resultClass="string"
4.resultClass="long"
5.resultClass="Java.util.HashMap"
三、parameterClass指的是select save update delete SQL语句的where执行条件
parameterClass可以的取值
1、parameterClass="int"
2、parameterClass="map"
3、parameterClass="com.sfbest.bean.AccountMerchantDistribution"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询