grails - Hibernate operation exception -
i running grails project. maybe question beginner, still important.
i have domain object, order. in order class model have declared datecreated datetime type using joda-time.
i using:'joda-time:joda-time:2.9.2'
however moment when order.save() called following error:
exception in thread "main" org.springframework.dao.dataintegrityviolationexception: hibernate operation: not execute statement; sql [n/a]; data truncation: data long column 'date_created' @ row 1; nested exception com.mysql.jdbc.mysqldatatruncation: data truncation: data long column 'date_created' @ row 1
can give me hint going on?
check out solution:
in domain class:
import org.joda.time.* import org.joda.time.contrib.hibernate.* datetime datecreated datetime lastupdated localdate birthday static mapping = { datecreated type: persistentdatetime lastupdated type: persistentdatetime birthday type: persistentlocaldate }
in config.groovy:
grails.gorm.default.mapping = { "user-type" type: persistentdatetime, class: datetime "user-type" type: persistentlocaldate, class: localdate }
or another solution.
Comments
Post a Comment