版权声明:转载请留言告知,注明出处 https://blog.csdn.net/qq_36213352/article/details/84848921
在写Java后台的数据返回值时报错:
错误提示如下:
Type Exception Report
Message Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'state' from result set. Cause: org.postgresql.util.PSQLException: 不良的类型值 int : t
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'state' from result set. Cause: org.postgresql.util.PSQLException: 不良的类型值 int : t
; ]; 不良的类型值 int : t; nested exception is org.postgresql.util.PSQLException: 不良的类型值 int : t
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
根据错误提示,发现这是因为我的pojo(实体类)的字段与数据库的字段类型不一致造成的
state我在数据库中写的是boolean类型,在实体类中写成了int,因此报错