Mybatis异常收集

来源:互联网 发布:自媒体 内容来源 知乎 编辑:程序博客网 时间:2024/06/07 22:26

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;}    }





















原创粉丝点击