Mapper icon indicating copy to clipboard operation
Mapper copied to clipboard

联级查询报错

Open pengguojin opened this issue 4 years ago • 0 comments

如下一对一连表查询会报错:

<resultMap type="com.smc.quartz.model.dto.IosBlockIpInfoDTO" id="baseListMap">
        <id column="ID" property="id" javaType="java.lang.Long" jdbcType="INTEGER"/>
        <result column="IP" property="ip" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <association column="{id=SAFETY_ID}" property="safe" select="selectSafety"/>
    </resultMap>

报错信息:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error creating lazy proxy.  Cause: java.lang.NullPointerException
	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
	at com.sun.proxy.$Proxy145.selectList(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
	at com.sun.proxy.$Proxy146.getListByParams(Unknown Source)

pengguojin avatar Dec 25 '20 10:12 pengguojin