報錯信息:
org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'user_photo' from result set. Cause: java.sql.SQLException: Error
; uncategorized SQLException; SQL state [null]; error code [0]; Error; nested exception is java.sql.SQLException: Error
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)
; uncategorized SQLException; SQL state [null]; error code [0]; Error; nested exception is java.sql.SQLException: Error
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)
解決辦法
在對應的實體類上加上兩個注解
//@Data 生成getter,setter ,toString等函數
//@NoArgsConstructor 生成無參構造函數
//@AllArgsConstructor //生成全參數構造函數