Reputation: 493
In each of my domains I have defined a custom sequence inside the static mapping closure:
static mapping = {
version false
id generator:'sequence', params:[sequence:'MY_SEQ']
}
When I create the database, the MY_SEQ sequence is there, however grails also still makes a default hibernate_sequence. How do I get grails to not make the default, and be certain that it is using my custom sequence? Is this common for Grails to generate a default even though it won't get used?
Upvotes: 4
Views: 877
Reputation: 3407
It is common and it comes from Hibernate by default, it's not a grails' thing. There's even a JIRA open for that, but still unresolved.
You could try to extend the dialect though! You can find a code that is kinda same thing you want in this topic.
About being sure if the table is using the specified sequence, it should, given the way you did it.
Upvotes: 1