Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.0.3
-
Fix Version/s: None
-
Component/s: Persistence
-
Labels:None
-
Environment:Postgres, Oracle DB's
Description
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).
Suggestion:
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:
http://www.nabble.com/One-%27hibernate_sequence%27-is-used-for-all-Postgres-tables-td17925737.html
Moving non-critical issues that aren't going to make it into 1.1 to 1.2