mappers

Reusing MyBatis ResultMap in multiple mapper.xml

亡梦爱人 提交于 2019-11-29 01:24:44
I would like to re-use a specific from different *Mapper.xml files which all somehow read same objects. I have a Database table called Project, which I created the following resultMap for: <resultMap id="ProjectMap" type="com.model.Project"> <id column="id" jdbcType="BIGINT" property="id" /> <result column="name" jdbcType="VARCHAR" property="name" /> <result column="client_prj_no" jdbcType="VARCHAR" property="clientPrjNo" /> <result column="notes" jdbcType="VARCHAR" property="notes" /> <result column="start_date" jdbcType="TIMESTAMP" property="startDate" /> ... <resultMap> It works great in

Reusing MyBatis ResultMap in multiple mapper.xml

情到浓时终转凉″ 提交于 2019-11-27 21:37:15
问题 I would like to re-use a specific from different *Mapper.xml files which all somehow read same objects. I have a Database table called Project, which I created the following resultMap for: <resultMap id="ProjectMap" type="com.model.Project"> <id column="id" jdbcType="BIGINT" property="id" /> <result column="name" jdbcType="VARCHAR" property="name" /> <result column="client_prj_no" jdbcType="VARCHAR" property="clientPrjNo" /> <result column="notes" jdbcType="VARCHAR" property="notes" />