Search code examples
grailsgrails-ormuuidpsql

Issues with GRAILS UUID and PSQL


I am trying to use UUID2 generator on grails 2.4.4, PSQL version 9.4.4. My current model setup is.

class ClassA {

   UUID id

   static mapping = {
       id generator:'uuid2', name:'uuid2', type:'pg-uuid'
       tablePerHierarchy false
   }
}

and

class ClassB extends ClassA {

    static constraints = {
    }

    static mapping = {
    }
}

but when I perform a run-app i always get an error.

ERROR context.GrailsContextLoaderListener - Error initializing the application: Error evaluating ORM mappings block for domain [ClassB]: null Message: Error evaluating ORM mappings block for domain [ClassB]: null

Any ideas what I did wrong?


Solution

  • Rename UUID id to UUID uuid2 or remove name: uuid2. As far as I know with name in mapping you assign the id generator to one of your properties.

    enter link description here