kaleidos / grails-postgresql-extensions

Grails plugin to use postgresql native elements such as arrays, hstores,...
Apache License 2.0
78 stars 63 forks source link

Grails 4.0.0 Sequence-per-table configuration #124

Open Noxville opened 4 years ago

Noxville commented 4 years ago

According to the installation guide it says:

For Hibernate 5 add the following to application.groovy

grails.gorm.default.mapping = {
    id generator: 'org.hibernate.id.enhanced.SequenceStyleGenerator', params: [prefer_sequence_per_entity: true]
}

This seems a bit weird/outdated/incorrect since my application.groovy looks like a spring boot boilerplate main (https://gist.github.com/Noxville/1a5232908f2fd19296261607a7244435).

ilopmar commented 4 years ago

That comment refers to ./grails-app/conf/application.groovy and not ./grails-app/init/.../Application.groovy

ilopmar commented 4 years ago

Fixed by @erichelgeson in https://github.com/kaleidos/grails-postgresql-extensions/pull/125

Noxville commented 4 years ago

Hey there, thanks for that fix @ilopmar, however even with that I'm still not seeing correctly generated sequences per table. Here's a gist with the relevant files: https://gist.github.com/Noxville/87e583d9a4340804a15afc75a87b0a81

ilopmar commented 4 years ago

@Noxville I haven't tried it with Grails 4. TBH I don't use it now but I keep maintaining it and merging PR from the community.

@erichelgeson have you tried the plugins with Grails 4 and the sequence per table?