以前存入的时间数据是 new Date();
dvciCheckInfoModel.setApplyTime(new Date());
dvciCheckInfoModel.setCreateDate(new Date());
生日的格式是
现在我从数据库获取到这些时间后又需要重新update进去时却报错了
Field error in object 'dvciCheckInfoModel' on field 'applyTime': rejected value [2016-05-04 17:16:07.0]; codes [typeMismatch.dvciCheckInfoModel.applyTime,typeMismatch.applyTime,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [dvciCheckInfoModel.applyTime,applyTime]; arguments []; default message [applyTime]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'applyTime'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type java.util.Date for value '2016-05-04 17:16:07.0'; nested exception is java.lang.IllegalArgumentException]
Field error in object 'dvciCheckInfoModel' on field 'birthday': rejected value [2016-05-11]; codes [typeMismatch.dvciCheckInfoModel.birthday,typeMismatch.birthday,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [dvciCheckInfoModel.birthday,birthday]; arguments []; default message [birthday]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'birthday'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type java.util.Date for value '2016-05-11'; nested exception is java.lang.IllegalArgumentException]
Field error in object 'dvciCheckInfoModel' on field 'createDate': rejected value [2016-05-04 17:16:07.0]; codes [typeMismatch.dvciCheckInfoModel.createDate,typeMismatch.createDate,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [dvciCheckInfoModel.createDate,createDate]; arguments []; default message [createDate]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'createDate'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type java.util.Date for value '2016-05-04 17:16:07.0'; nested exception is java.lang.IllegalArgumentException]
数据库中生日的时间类型是Date
另外两个是Datetime
小白我弄了好长时间了,求解答啊