When using PostgreSQL together with Grails, one thing that has annoyed me when creating domain classes is that I have to manually add a line for telling hibernate how it should create, name and use the sequences.
Finally Hibernate now has a new SequenceStyleGenerator this solves this:
Create your application.groovy file, application.yml will not work and write this:
grails.gorm.default.mapping = {
id (
generator: 'org.hibernate.id.enhanced.SequenceStyleGenerator',
params: [prefer_sequence_per_entity: true]
)
}