欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Mybatis异常收集

程序员文章站 2022-07-14 11:03:35
...

Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'surveyAdminExpandVo' in 'class com.survey.toysrus.model.SurveyAdminExpandVo'

其实这种错误很明显:异常已经告诉我们字段 surveyAdminExpandVo 不再 SurveyAdminExpandVo类中

在看到我的配置文件:

<mapper namespace="com.survey.toysrus.dao.SurveyAdminExpandMapper">
   <insert id="insert"  parameterType="SurveyAdminExpandVo">
        INSERT INTO  survey_admin  VALUES(NULL,
        <if test="surveyAdminExpandVo != null">
            <if test="surveyAdminExpand.adminname !=null and surveyAdminExpand.adminname !=''">
               '${surveyAdminExpand.adminname}',
            </if>
            <if test="surveyAdminExpand.password !=null and surveyAdminExpand.password !=''">
                '${surveyAdminExpand.password}',
            </if>
              NOW(),NOW())
        </if>
   </insert>
</mapper>


在实体类中没有这个字段自然配置文件也就无法找到
surveyAdminExpandVo 



实体类

public class SurveyAdminExpandVo {
    
    private SurveyAdmin surveyAdmin;
    
    private SurveyAdminExpand surveyAdminExpand;

    
	public SurveyAdmin getSurveyAdmin() {
		return surveyAdmin;
	}

	public void setSurveyAdmin(SurveyAdmin surveyAdmin) {
		this.surveyAdmin = surveyAdmin;
	}

	public SurveyAdminExpand getSurveyAdminExpand() {
		return surveyAdminExpand;
	}

	public void setSurveyAdminExpand(SurveyAdminExpand surveyAdminExpand) {
		this.surveyAdminExpand = surveyAdminExpand;
	}
    	
}