postgre-hibernate-mapper is the small project addressing this issue http://stackoverflow.com/questions/7580807/hibernate-postgresql-with-grails
Java
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
src/main/java/ru/megadevelopers/hibernate/dialect
.gitignore
README.md
build.gradle
gradlew
gradlew.bat

README.md

postgre-hibernate-mapper

Project is deprecated.

This project should be considered deprecated, as in hibernate 4.1.3 sequence-per-table was added as the new config option (issue, commit).

Config should look something like this (grails app example):

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

Build Status

postgre-hibernate-mapper is the small project to handle default hibernate id generation strategy. Main goal of this project is to have solution in one place.

HOW-TO

Just add this dependency to your project: for hibernate 3

compile 'ru.megadevelopers:postgres-hibernate-mapper:1.0'

for hibernate 4

compile 'ru.megadevelopers:postgres-hibernate-mapper:2.0'

Then set dialect in hibernate config:

hibernate.dialect=ru.megadevelopers.hibernate.dialect.SequencePerTablePostgresDialect

Credits to Burt Beckwith http://grails.1312388.n4.nabble.com/One-hibernate-sequence-is-used-for-all-Postgres-tables-td1351722.html