首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

Cause: No type handler could be found to 地图 the property 'reporter' to the colu

2012-10-20 
Cause: No type handler could be found to map the property reporter to the colu在做根据ID查询一个

Cause: No type handler could be found to map the property 'reporter' to the colu
在做根据ID查询一个带有外键的主表类时,如果在映射文件方法里返回结果使用相应类,则会报此种错误:Cause: com.ibatis.sqlmap.client.SqlMapException: No type handler could be found to map the property 'reporter' to the column 'reporter'.  One or both of the types, or the combination of types is not supported.

解决办法:使用resultMap。

错误代码:

<select id="selectPetitonLetterById" parameterresultname="code"><resultMap id="PetitionLetterResult" column="id"/>    <result property="identifier" column="identifier"/>    <result property="reporter" column="reporter" select="selectReporter"/>    <result property="letterInformation" column="letterInformation" select="selectLetterInformation"/>    <result property="supervision" column="supervision" select="selectSupervision"/>    <result property="processFlow" column="processFlow" select="selectProcessFlow"/>  </resultMap><select id="selectPetitonLetterById" parameterresultMap="PetitionLetterResult">select * from t_petitionletter where id = #id#  </select>

热点排行