Search code examples
grailskeyauto-generate

grails: randomized auto id's


In a default install of rails when you save the first domain object it gives a fancy randomized id like 785787634 or something. Grails gives 1.

What is the preferred method of making difficult-to-guess and unlikely-to-intersect auto generated ids in grails?


Solution

  • Grails allows you to customize the id generator. see http://grails.org/doc/latest/guide/GORM.html#identity

    In your case, you could consider 'uuid' or 'guid'