Mybatis映射 mybatismap 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谢谢你的回复,考虑过typeHandler,但是我看mybatis自有的一些实现类,感觉它是对每一个元数据进行处理的,它的方法的参数是这个元数据的索引或者列名。那么这样做其实也就把程序写死了。 那个属性的map可以再配置成一个类,类的嵌套配置是这样的,我下面有个例子<resultMap id="ss" class="scene"> <result column="sid" property="sid" jdbcType="BIGINT" javaType="java.lang.Long" /> <result column="sname" property="sname" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="sstatus" property="sstatus" jdbcType="int" javaType="java.lang.Integer" /> <result column="offer_total_flag" property="sofferTotalFlag" jdbcType="int" javaType="java.lang.Integer" /> <result column="rid" property="rule.rid" jdbcType="BIGINT" javaType="java.lang.Long" /> <result column="rscene_id" property="rule.rsceneId" jdbcType="BIGINT" javaType="java.lang.Long" /> <result column="rgroup_name" property="rule.rgroupName" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="rgroup_order" property="rule.rgroupOrder" jdbcType="int" javaType="java.lang.Integer" /> <result column="rgroup_type" property="rule.rgroupType" jdbcType="int" javaType="java.lang.Integer" /> <result column="rgroup_status" property="rule.rgroupStatus" jdbcType="int" javaType="java.lang.Integer" /> <result column="rgroup_flag" property="rule.rgroupFlag" jdbcType="int" javaType="java.lang.Integer" /> <result column="rgroup_content_flag" property="rule.rgroupContentFlag" jdbcType="int" javaType="java.lang.Integer" /> <result column="rgroup_content_parent_id" property="rule.rgroupContentParentId" jdbcType="BIGINT" javaType="java.lang.Long" /> <result column="rfield1" property="rule.rfield1" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="rfield2" property="rule.rfield2" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="rfield3" property="rule.rfield3" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="cscene_id" property="rule.content.csceneId" jdbcType="BIGINT" javaType="java.lang.Long" /> <result column="cgroup_id" property="rule.content.cgroupId" jdbcType="BIGINT" javaType="java.lang.Long" /> <result column="cnode_id" property="rule.content.cnodeId" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="cnode_name" property="rule.content.cnodeName" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="cnode_value" property="rule.content.cnodeValue" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="cnode_parent_id" property="rule.content.cnodeParentId" jdbcType="BIGINT" javaType="java.lang.Long" /> <result column="cgroup_node_parent_id" property="rule.content.cgroupNodeParentId" jdbcType="BIGINT" javaType="java.lang.Long" /> <result column="cnode_order" property="rule.content.cnodeOrder" jdbcType="int" javaType="java.lang.Integer" /> <result column="cnode_flag" property="rule.content.cnodeFlag" jdbcType="int" javaType="java.lang.Integer" /> <result column="cnode_offer_total" property="rule.content.cnodeOfferTotal" jdbcType="int" javaType="java.lang.Integer" /> <result column="cfield1" property="rule.content.cfield1" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="cfield2" property="rule.content.cfield2" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="cfield3" property="rule.content.cfield3" jdbcType="VARCHAR" javaType="java.lang.String" /> <result column="cid" property="cid" jdbcType="BIGINT" javaType="java.lang.Long" /> </resultMap> 还是建议别费事了,mybatis对于一对多支持非常不好,就算能配置也不方便,不如算了。 开发ssh2时报Cannot open connection错误,求解 java 异常处理 如何使用Struts开发登录功能 struts2标签 请问:多进程共用一个Log4j是否会产生互锁,应如何解决? ajax提交 问个很深奥的问题 一个关于登陆的简单问题? 有关struts 中的plugIn 技术问题 奇怪了,为什么这个问题以前都没有遇到过呢?有关中文问题,大家看看,较怪! Struts2上传文件 有些临时文件不会自动删除,求解决办法~ spring + jspsmartupload 一直有空指针异常怎么处理?
<result column="sid" property="sid" jdbcType="BIGINT" javaType="java.lang.Long" />
<result column="sname" property="sname" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="sstatus" property="sstatus" jdbcType="int" javaType="java.lang.Integer" />
<result column="offer_total_flag" property="sofferTotalFlag" jdbcType="int" javaType="java.lang.Integer" />
<result column="rid" property="rule.rid" jdbcType="BIGINT" javaType="java.lang.Long" />
<result column="rscene_id" property="rule.rsceneId" jdbcType="BIGINT" javaType="java.lang.Long" />
<result column="rgroup_name" property="rule.rgroupName" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="rgroup_order" property="rule.rgroupOrder" jdbcType="int" javaType="java.lang.Integer" />
<result column="rgroup_type" property="rule.rgroupType" jdbcType="int" javaType="java.lang.Integer" />
<result column="rgroup_status" property="rule.rgroupStatus" jdbcType="int" javaType="java.lang.Integer" />
<result column="rgroup_flag" property="rule.rgroupFlag" jdbcType="int" javaType="java.lang.Integer" />
<result column="rgroup_content_flag" property="rule.rgroupContentFlag" jdbcType="int" javaType="java.lang.Integer" />
<result column="rgroup_content_parent_id" property="rule.rgroupContentParentId" jdbcType="BIGINT" javaType="java.lang.Long" />
<result column="rfield1" property="rule.rfield1" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="rfield2" property="rule.rfield2" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="rfield3" property="rule.rfield3" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="cscene_id" property="rule.content.csceneId" jdbcType="BIGINT" javaType="java.lang.Long" />
<result column="cgroup_id" property="rule.content.cgroupId" jdbcType="BIGINT" javaType="java.lang.Long" />
<result column="cnode_id" property="rule.content.cnodeId" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="cnode_name" property="rule.content.cnodeName" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="cnode_value" property="rule.content.cnodeValue" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="cnode_parent_id" property="rule.content.cnodeParentId" jdbcType="BIGINT" javaType="java.lang.Long" />
<result column="cgroup_node_parent_id" property="rule.content.cgroupNodeParentId" jdbcType="BIGINT" javaType="java.lang.Long" />
<result column="cnode_order" property="rule.content.cnodeOrder" jdbcType="int" javaType="java.lang.Integer" />
<result column="cnode_flag" property="rule.content.cnodeFlag" jdbcType="int" javaType="java.lang.Integer" />
<result column="cnode_offer_total" property="rule.content.cnodeOfferTotal" jdbcType="int" javaType="java.lang.Integer" />
<result column="cfield1" property="rule.content.cfield1" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="cfield2" property="rule.content.cfield2" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="cfield3" property="rule.content.cfield3" jdbcType="VARCHAR" javaType="java.lang.String" />
<result column="cid" property="cid" jdbcType="BIGINT" javaType="java.lang.Long" />
</resultMap>