今天遇到了一个错误,查询所有字段就不报错,查询单个字段就报错了。
org.springframework.dao.DataIntegrityViolationException: Error attempting to get column ‘user_name’ from result set. Cause: java.sql.SQLDataException: Cannot determine value type from string ‘xxx’
; Cannot determine value type from string ‘xxx’; nested exception is java.sql.SQLDataException: Cannot determine value type from string ‘xxx’
走到这里发现,通过有参构造创建的对象。
org.apache.ibatis.executor.resultset.DefaultResultSetHandler#createByConstructorSignature

是实体没设置是有参构造,新增一个无参构造解决。
@NoArgsConstructor
361

被折叠的 条评论
为什么被折叠?



