Type: New Feature
Resolution: Won't Fix
Affects Version/s: 1.0.3
Fix Version/s: None
Environment:Postgres, Oracle DB's
Using create-drop on a Postgres database GORM creates just one DB sequence 'hibernate_sequence' for all
tables (I suppose this default behavior is inherited from Hibernate?)
From what I know the best practice would be to define one sequence per table.
Sure, you can define
"id generator:'sequence', params:[sequence:'mydomain_id_sequence']"
on each of your domain classes.
But that's definitely not DRY.
I tried to define the mapping for the id-generator in an abstract parent class, hoping
that the definition is inherited by each subclass.
That's working neither (I think to remember there was another thread describing
that mapping inheritance is not implemented on this level).
Wouldn't it be reasonable if Grails implements a better default for sequence creation:
"Create one db sequence per table naming it 'tableName_sequence'"
Check out the thread 'One 'hibernate_sequence' is used for all Postgres tables' for more discussion on this: