4

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Great, thanks! I am going to test it out as is, and if I find there is issues, then I will look into the dialect.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.