当前位置:Gxlcms > 数据库问题 > 【串线篇】SQL映射文件-resultMap自定义封装

【串线篇】SQL映射文件-resultMap自定义封装

时间:2021-07-01 10:21:17 帮助过:2人阅读

select id="getCatById" resultMap="mycat"> select * from t_cat where id=#{id} </select> <resultMap type="com.atguigu.bean.Cat" id="mycat"> <!-- 指定主键列的对应规则; column="id":指定哪一列是主键列 property="":指定Cat的哪个属性封装id这一列数据 --> <id property="id" column="id"/> <!-- 普通列 --> <result property="name" column="cName"/> <result property="age" column="cAge"/> <result property="gender" column="cgender"/> </resultMap>

 

 

 

【串线篇】SQL映射文件-resultMap自定义封装

标签:end   gen   bsp   strong   主键   数据库   nbsp   这一   col   

人气教程排行