在mybatis plus中解析mapper.xml时无法找到类。具有如下结构的json响应类
@Data
@Builder
@Setter
@Getter
public class StudentCourseDetailsRes {
@Valid
@JsonProperty("courseDtls")
private ArrayList<CourseDtls> courseDtlsList;
@Setter
@Getter
@Builder
public static class CourseDtls {
private String courseName;
private String courseDuration;
@Valid
private ArrayList<ErrDetails> errorDetailList;
@Setter
@Getter
@Builder
@Data
public static class ErrDetails {
private string errorCode;
private string errorMessage;
}
}
}
像下面这样定义mapper.xml
<mapper namespace="mapper.StudentMapper">
<select id="studentproc" statementType="CALLABLE" parameterType="java.util.Map" resultMap="stuCourse">
{call package.student_course_proc(
#{stuId, jdbcType=VARCHAR,javaType=java.lang.String,mode=IN},#{courseName, jdbcType=VARCHAR,javaType=java.lang.String,mode=OUT},#{couseDetails, jdbcType=VARCHAR,javaType=java.lang.String,mode=OUT},#{errorCode, jdbcType=VARCHAR,javaType=java.lang.String,mode=OUT},#{errorMessage, jdbcType=VARCHAR,javaType=java.lang.String,mode=OUT}
</select>
<resultMap id="stuCourse" type="entity.StudentCourseDetailsRes">
<collection property="courseDtlsList" ofType="entity.StudentCourseDetailsRes.CourseDtls">
<collection property="courseDtls">
<result property="courseName" />
<result property="courseDuration"/>
<collection property="errorDetailList" ofType="entity.StudentCourseDetailsRes.CourseDtls.ErrDetails">
<collection property="courseDtls">
<result property="errorCode"/>
<result property="errorMessage"/>
</collection>
</collection>
</collection>
</collection>
</resultMap>
</mapper>
当运行应用程序面临ClassNotFoundException问题时:找不到类class entity.StudentCourseDetailsRes.CourseDtls
请指导在这种情况下如何配置mapper.xml。
可以通过向paramMap添加程序输出参数来解决此问题。