mybatis异常集之Cannot determine value type from string ‘xxx‘

报错:

2021-04-08 10:37:12.908 ERROR 11704 --- [nio-8081-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'House_number' from result set.  Cause: java.sql.SQLDataException: Cannot determine value type from string '3-1'
; Cannot determine value type from string '3-1'; nested exception is java.sql.SQLDataException: Cannot determine value type from string '3-1'] with root cause

原因分析:
在所调用的实体类中自定义了含参构造函数(且没有对所有参数赋值),导致实体类不会自动生成无参构造函数,但是获取数据时又需要调用无参构造函数,从而导致冲突报错。

解决方法:
下面链接的博主已经讲的很好了,转下…
添加链接描述

你可能感兴趣的:(spring,boot,小细节,java)