用hibernate的时候遇到日期全为0不能转换的情况,不知道怎么解决 100
2014/09/0509:33:00,842[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]-[WARN]SQLErr...
2014/09/05 09:33:00,842 [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]-[WARN] SQL Error: 0, SQLState: S1009
2014/09/05 09:33:00,842 [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]-[ERROR] Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.loader.Loader.doList(Loader.java:2519)
at org.hibernate.loader.Loader.doList(Loader.java:2502)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2332)
at org.hibernate.loader.Loader.list(Loader.java:2327)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:490)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1268)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
at com.hyron.b2b2p.vo.PageBean.page(PageBean.java:167)
at com.hyron.b2b2p.persistence.dao.UserDaoImpl.getPage(UserDaoImpl.java:272)
at com.hyron.b2b2p.service.AuthenticationServiceImpl.getPage(AuthenticationServiceImpl.java:1505)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) 展开
2014/09/05 09:33:00,842 [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]-[ERROR] Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.loader.Loader.doList(Loader.java:2519)
at org.hibernate.loader.Loader.doList(Loader.java:2502)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2332)
at org.hibernate.loader.Loader.list(Loader.java:2327)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:490)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1268)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
at com.hyron.b2b2p.vo.PageBean.page(PageBean.java:167)
at com.hyron.b2b2p.persistence.dao.UserDaoImpl.getPage(UserDaoImpl.java:272)
at com.hyron.b2b2p.service.AuthenticationServiceImpl.getPage(AuthenticationServiceImpl.java:1505)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询