报错org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column ‘xxx‘ from resu

报错如下:Error attempting to get column 'xxx' from result set. Cause: java.sql.SQ LException

报错org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column ‘xxx‘ from resu_第1张图片

 

 如果要写一个构造方法,那么记得要写一个默认的无参构造函数

如果不想写代码,可以借助使用  @NoArgsConstructor 注解加在实体类上,也是基于Lombok的注解,和 @Data注解区别在于,该注解会稳定生成一个 无参构造函数,而@Data注解下,如果写一个自己的构造函数,那么无参构造函数将被覆盖

说明你的实体接收类重写了构造函数,并且你的构造函数无法对应上你的Sql查询语句。

报错org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column ‘xxx‘ from resu_第2张图片

你可能感兴趣的:(杂谈,java,开发语言)