天冷就回家0202 2014-08-29 15:03 采纳率: 0%
浏览 1889

急急急!!!ibatis一对多映射查询操作 千回百转仍无法定位异常

直接上代码吧
先看基础类public class MetaInfo extends BaseObject{
private String id ; //索引
private String ename ; //字段名称
private String type ; //字段类型
private String length ; //字段长度
private String cname ; //中文名称
private String iskey ; //是否主键
private String originalName ; //元数据名称
private String remark ; //备注
private String tableinfoId ; //关联表信息编号
private String systeminfoid ; //关联系统编号
private List<Department> departList = new ArrayList<Department>(); //组织机构列表
getter,setter方法

再看ibatis配置

<typeAlias alias="metaInfo"    type="app.catalog.catalogservices.metaservices.dao.domain.MetaInfo" />
<typeAlias alias="deptInfo" type="app.admin.department.info.domain.Department" />
<select id="getDepatInfo" parameterClass="java.lang.String" resultClass="deptInfo" >
 select id,shortname,name_en from sys_department 
</select>
<resultMap id="getScope" class="metaInfo">
    <result property="id" column="id"></result>
    <result property="tableinfoId" column="tableinfoId"></result>
    <result property="departList" column="id" select="app.catalog.catalogservices.metaservices.dao.domain.MetaInfo.getDepatInfo"></result>
</resultMap>
<select id="queryForPageElements"  parameterClass="metaInfoPageQueryObject" resultMap="getScope" >
select id,tableinfoid from tacc_pubfieldinfo t where t.IFUSE = 'y'      </select>

异常信息:

--- The error occurred in app/catalog/catalogservices/metaservices/dao/biz/MetaInfo.xml.  

--- The error occurred while applying a result map.

--- Check the app.catalog.catalogservices.metaservices.dao.domain.MetaInfo.getScope.

--- Check the result mapping for the 'departList' property.

--- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:

--- The error occurred in app/catalog/catalogservices/metaservices/dao/biz/MetaInfo.xml.

--- The error occurred while applying a result map.

--- Check the app.catalog.catalogservices.metaservices.dao.domain.MetaInfo.getScope.

--- Check the result mapping for the 'departList' property.
反复对照,无法确定问题出在何处,纠结中,请各位朋友指点

  • 写回答

1条回答

  • 普通网友 2016-07-12 01:11
    关注

    select属性不是写sql,而是select标签的id

    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?