<!--使用resultMap
1>先定义resultMap
2>在select标签,使用resultMap来引用1来定义de
-->
<!--定义resultMap
id:自定义名称,表示你定义的这个resultMap
type:java类型的全限定名称
-->
<resultMap id="studentMap" type="com.bjpowernode.domain.Student">
<!--列名和java属性的关系-->
<!-- 注解列,使用id标签
column:列名
property:java类型的属性名
-->
<id column="id" property="id"/>
<!--非主键列使用result-->
<result column="name" property="name"/>
<result column="age" property="age"/>
<result column="email" property="email"/>
</resultMap>
<select id="selectAllStudent" resultMap="studentMap">
select id,name,email from student
</select>
mybais resulttype的使用 resultType返回resultmap
最新推荐文章于 2022-07-07 10:35:03 发布