Thursday, January 17, 2013

Fixing GORM UserType after migration to version 2

Grails allows to define custom UserType to properties like in regular Hibernate, by specifying them next to properties in domain objects, like:

  someproperty type: MyUserType

But after migrating to Grails 2.2, these stopped working and Grails started to treat them as plain objects (enumerations in my particular case). Fortunately, this was easy to fix by defining all custom user types in Config.groovy, like:

grails.gorm.default.mapping = {
  'myproperty-type'(type:, class:

This also defines mapping for all properties of specific type, so no need to do it in every domain class.

1 comment:

  1. The King Casino - Atlantic City, NJ | Jancasino
    Come on in the King 토토 사이트 Casino for fun, no wagering requirements, delicious dining, and enjoyable casino gaming all at the heart of Atlantic City. apr casino