1、mybatis的实体类继承
参考资料:
1、mybatis中实体类,po类继承另一个po类的情况
2、mybatis中resultMap配置细则
实体类的继承的作用是:可以通过继承减少代码在实体类中的重复使用,比如数据库的表中常常出现的字段所对应的实体类中的属性。
2、mybatis的resultMap标签中的属性extends,可以继承另外一个命名空间的resultMap标签。
<mapper namespace="xuecheng.dao.ACVSFundTest">
<resultMap id="res" extends="xuecheng.dao.BaseEntityTest.baseCol" type="xuecheng.domain.ACVSFund">
<!--<id column="id" property="id"/>-->
<result column="fund_code" property="fundCode"/>
<result column="fund_name" property="fundName"/>
<result column="gmt_Create" property="gmtCreate"/>
</resultMap>
继承另一个
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="xuecheng.dao.BaseEntityTest">
<resultMap id="baseCol" type="xuecheng.domain.BaseEntity">
<id column="id" property="id"/>
<result column="username" property="username"/>
<result column="age" property="age"/>
</resultMap>
一、mybatis的属性标签
<resultMap>
<constructor>
<idArg/>