Configuring Postgres in Grails

試著忘記壹切 提交于 2019-12-06 04:48:19

Hibernate creates a single sequence for all tables in both Postgres and Oracle, but it's easy to create a single sequence per table. See this solution: http://grails.1312388.n4.nabble.com/One-hibernate-sequence-is-used-for-all-Postgres-tables-td1351722.html#a1351725

To use the custom dialect, create the class in src/groovy or src/java. Use whatever package and class name you want. To register it in Grails, set the dialect property in the dataSource block in DataSource.groovy, e.g.

dataSource {
   pooled = true
   dialect = com.foo.bar.MyDialect
   driverClassName = ...
   username = ...
   password = ...
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!