mybatis-plus类型报错问题记录

  • Post author:
  • Post category:其他


Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column ‘userName’ from result set.  Cause: java.lang.NumberFormatException: For input string: “user”] with root cause

java.lang.NumberFormatException: For input string: “user”

但是对象元素是字符串类型

private String userName;

找了很多方法,但是不适用。

发现是由于申明了全参构造方法导致,需要手动增加一个无参构造。重启后正常。



版权声明:本文为qq_30714157原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。