2014-05-15 80 views
0

我是groovy中的新成員grails.I面臨着從excelsheet到數據庫中保存日期的問題。我的日期形式爲2014-02-15。我所做的更改到Config.groovy中的日期日期不能保存到數據庫中

grails.databinding.dateFormats = ['dd/mm/yyyy','yyyy-MM-dd'] 

但還是會告訴我喜歡

ERROR context.GrailsContextLoader - Error initializing the application: Validation Error(s) occurred during save(): 
- Field error in object 'org.grails.importexcel.SandyData' on field 'purchaseOrderDate': rejected value [2014-02-15]; codes [org.grails.importexcel.SandyData.purchaseOrderDate.typeMismatch.error,org.grails.importexcel.SandyData.purchaseOrderDate.typeMismatch,sandyData.purchaseOrderDate.typeMismatch.error,sandyData.purchaseOrderDate.typeMismatch,typeMismatch.org.grails.importexcel.SandyData.purchaseOrderDate,typeMismatch.purchaseOrderDate,typeMismatch.java.lang.String,typeMismatch]; arguments [purchaseOrderDate]; default message [Could not find matching constructor for: java.lang.String(org.joda.time.LocalDate)] 
Message: Validation Error(s) occurred during save(): 

錯誤信息任何人都可以給我這個解決方案。

謝謝

回答