sqlMapConfig中sqlMap的顺序必须是串行的,即被调用class所在的xml文件必须在调用的xml文件前面,如:
<sqlMap resource="META-INF/sqlmap/hosts.xml" /> <sqlMap resource="META-INF/sqlmap/jmeter.xml" />
在host.xml中
<typeAlias alias="agent" type="com.XXX.vajra.entity.Agent" /> <resultMap id="agentResult" class="agent"> <result column="vajra_hosts.identify_id" property="identifyId" jdbcType="INTEGER" /> <result column="vajra_hosts.user_name" property="userName" jdbcType="VARCHAR" /> <result column="vajra_hosts.passwd" property="passWd" jdbcType="VARCHAR" /> <result column="vajra_hosts.host" property="host" jdbcType="VARCHAR" /> <result column="vajra_hosts.owner" property="owner" jdbcType="VARCHAR" /> <result column="vajra_hosts.owner_id" property="ownerId" jdbcType="INTEGER" /> <result column="vajra_hosts.description" property="desc" jdbcType="VARCHAR" /> <result column="vajra_hosts.gmt_create" property="gmtCreate" /> <result column="vajra_hosts.gmt_modify" property="gmtModified" /> </resultMap>
在jmeter.xml中
<resultMap id="agentResult" class="agent"> <result column="gmt_create" property="gmtCreate" /> <result column="gmt_modify" property="gmtModified" /> </resultMap>
此时host.xml必须放置在jmeter.xml中,否则会报错,找不到class agent