问题
2022-04-27 14:31:09.417 ERROR 14280 — [nio-9305-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Error attempting to get column ‘hotel_name’ from result set. Cause: java.sql.SQLDataException: Cannot determine value type from string ‘七天连锁’ ; Cannot determine value type from string ‘七天连锁’; nested exception is java.sql.SQLDataException: Cannot determine value type from string ‘七天连锁’] with root cause
com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from string ‘七天连锁’ at com.mysql.cj.result.AbstractNumericValueFactory.createFromBytes(AbstractNumericValueFactory.java:66) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.protocol.a.MysqlTextValueDecoder.decodeByteArray(MysqlTextValueDecoder.java:134) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.protocol.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:133) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.protocol.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:241) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.protocol.a.result.ByteArrayRow.getValue(ByteArrayRow.java:91) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.jdbc.result.ResultSetImpl.getObject(ResultSetImpl.java:1296) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.jdbc.result.ResultSetImpl.getInt(ResultSetImpl.java:797) ~[mysql-connector-java-8.0.20.jar:8.0.20]
2022-04-27 14:32:15.159 ERROR 14280 — [nio-9305-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Error attempting to get column ‘status’ from result set. Cause: java.sql.SQLDataException: Unsupported conversion from LONG to java.sql.Timestamp ; Unsupported conversion from LONG to java.sql.Timestamp; nested exception is java.sql.SQLDataException: Unsupported conversion from LONG to java.sql.Timestamp] with root cause
com.mysql.cj.exceptions.DataConversionException: Unsupported conversion from LONG to java.sql.Timestamp at com.mysql.cj.result.DefaultValueFactory.unsupported(DefaultValueFactory.java:70) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.result.DefaultValueFactory.createFromLong(DefaultValueFactory.java:86) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.protocol.a.MysqlTextValueDecoder.decodeInt1(MysqlTextValueDecoder.java:89) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.protocol.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:96) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.protocol.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:241) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.protocol.a.result.ByteArrayRow.getValue(ByteArrayRow.java:91) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.jdbc.result.ResultSetImpl.getTimestamp(ResultSetImpl.java:914) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.jdbc.result.ResultSetImpl.getTimestamp(ResultSetImpl.java:959) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.alibaba.druid.pool.DruidPooledResultSet.getTimestamp(DruidPooledResultSet.java:365) ~[druid-1.1.23.jar:1.1.23]
使用框架的时候需要注意domain的实体类中要添加构造方法。mybatis中的Mapper的方法执行的时候是需要通过构造方法来返回想要的实体对象
|