在数据库中的时间字段类型一般为datetime类型,但是一般情况使用dto的时候可能会使用String类型,这个时候查找的时候,如果数据库这个字段的值为0000-00-00 00:00:00,那么查找的时候是无法对应到String类型上面去的,会报如下错误:
Error attempting to get column 'XXX' from result set. Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp↵; ]; Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp; nested exception is java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp