亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

mybatis里sql映射文件怎么寫

mybatis里sql映射文件怎么寫

fenkapian 2016-11-10 15:16:55
這是接口里的方法:public?List<BlogrollEntity>?selectByTitle(String?bTitle);? ? 這是上面方法對應的sql:<select id="selectByTitle" resultMap="BaseResultMap" parameterType="java.lang.String">? ? ? ? select? ? ? ? <include refid="Base_Column_List" />? ? ? ? from blogroll? ? ? ? where b_title = #{bTitle,jdbcType=VARCHAR}? ? </select>為什么第五行要加jdbcType=VARCHAR?還有映射文件里下面這段為什么都要加jdbcType=****?<resultMap id="BaseResultMap" type="com.portalManager.web.model.Entity.BlogrollEntity">? ? ? ? <id column="id" property="id" jdbcType="VARCHAR" />? ? ? ? <result column="b_title" property="bTitle" jdbcType="VARCHAR" />? ? ? ? <result column="b_url" property="bUrl" jdbcType="VARCHAR" />? ? ? ? <result column="b_details" property="bDetails" jdbcType="VARCHAR" />? ? ? ? <result column="b_create_time" property="bCreateTime" jdbcType="VARCHAR" />? ? ? ? <result column="b_is_deleted" property="bIsDeleted" jdbcType="BIGINT" />? ? ? ? <result column="b_web_code" property="bWebCode" jdbcType="VARCHAR" />? ? </resultMap>
查看完整描述

1 回答

?
慕粉3233872

TA貢獻70條經驗 獲得超29個贊

驗證該字段在數據庫中的類型吧,我之前都沒寫過,不是一定要寫的吧

查看完整回答
反對 回復 2016-11-10
  • 1 回答
  • 0 關注
  • 1338 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號