通过resultMap结果集映射
<resultMap id="MyStudentMap2" type="com.bjpowernode.domain.MyStudent">
<!--列名和java属性的关系-->
<!-- 注解列,使用id标签
column:列名
property:java类型的属性名
-->
<id column="id" property="myid"/>
<!--非主键列使用result-->
<result column="name" property="myname"/>
<result column="age" property="myage"/>
<result column="email" property="myemail"/>
</resultMap>
<select id="selectAllStudent2" resultMap="MyStudentMap2">
select id ,name ,email ,age from student
</select>