Caused by: java.sql.SQLException: Cannot convert value '1' from column 1 to TIMESTAMP.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ResultSetRow.getTimestampFast(ResultSetRow.java:1321)
at com.mysql.jdbc.ByteArrayRow.getTimestampFast(ByteArrayRow.java:124)
at com.mysql.jdbc.ResultSetImpl.getTimestampInternal(ResultSetImpl.java:6617)
at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:5943)
at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:5981)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.logging.jdbc.ResultSetLogger.invoke(ResultSetLogger.java:68)
at com.sun.proxy.$Proxy14.getTimestamp(Unknown Source)
at org.apache.ibatis.type.DateTypeHandler.getNullableResult(DateTypeHandler.java:39)
at org.apache.ibatis.type.DateTypeHandler.getNullableResult(DateTypeHandler.java:28)
at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:66)
... 45 more
Caused by: java.sql.SQLException: Bad format for Timestamp '1' in column 1.
at com.mysql.jdbc.ResultSetRow.getTimestampFast(ResultSetRow.java:1295)
... 58 more
咳咳,这个bug是使用CV大法之后忘记修改造成的,下面这个是修改前的(被自己蠢到)
//查询所有用户
@Select("select * from user ")
@Results(id="userMap",value = {
@Result(id=true,column = "id",property = "userId"),
@Result(column = "id",property = "userName"),
@Result(column = "id",property = "userAddress"),
@Result(column = "id",property = "userSex"),
@Result(column = "id",property = "userBirthday"),
})
List<User> findAll();
这个是修改后的
//查询所有用户
@Select("select * from user ")
@Results(id="userMap",value = {
@Result(id=true,column = "id",property = "userId"),
@Result(column = "username",property = "userName"),
@Result(column = "address",property = "userAddress"),
@Result(column = "sex",property = "userSex"),
@Result(column = "birthday",property = "userBirthday"),
})
List<User> findAll();
修改完之后,运行,OK解决了!