Error attempting to get column'xxx' from result set. Cause: java.sql.SQLException: Cannot be converted to internal representation, error resolution during Oracle database query

created at 10-17-2021 views: 112

error log:

org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column'xxx' from result set. Cause: java.sql.SQLException: Cannot be converted to internal representation
; uncategorized SQLException; SQL state [99999]; error code [17059]; Cannot be converted to internal representation; nested exception is java.sql.SQLException: Cannot be converted to internal representation

There are many errors that can cause this problem. I said that I made the error because I used the @Builder annotation in the LomBok plugin.

  • The first solution is to just get rid of this annotation, and you can directly xxx.setXXX when assigning the object;
  • The second solution is to add these two annotations on LOMBOK @AllArgsConstructor @NoArgsConstructor to add a construction method with no parameters and all parameters,

Simply put, mybatis needs to use the parameterless construction method when querying. The @Builder annotation is added, which leads to the absence of parameterless construction, resulting in an error.

In summary, there is a problem

Solution 1: Directly kill the @Builder annotation on the entity class

Solution 2: Add @AllArgsConstructor @NoArgsConstructor annotation to the entity class

created at:10-17-2021
edited at: 10-17-2021: