繁体   English   中英

如何在Grails 3.0.1中设置hibernate方言

[英]How to set the hibernate dialect in Grails 3.0.1

我正在尝试新的Grails 3堆栈,我已经遇到了gorm / hibernate的障碍。 我有一个自定义的hibernate方言来支持一些数据库功能,但application.yml文件中的方言设置似乎被忽略:

dataSource:
    dialect: "our.namespace.Dialect"
    pooled: true
    jmxExport: false
    driverClassName: "org.postgresql.Driver"        
    username: user
    password: password
    dbCreate: 'update'

our.namespace.Dialect似乎永远不会被实例化,并且gorm在尝试创建数据库时会抛出以下错误:

ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - HHH000299: Could not complete schema update
org.hibernate.MappingException: No Dialect mapping for JDBC type: 90001

类型90001是方言应处理的JDBC类型代码之一。

这个代码和设置在我工作的Grails 2.xy项目中运行良好。

如何在Grails 3.0.1中设置hibernate方言?

看来这是Grails 3.0.1的已知问题,并且有一个开放的错误报告:

https://github.com/grails/grails-core/issues/614

目前的解决方法是在application.yml文件的hibernate部分设置方言:

hibernate:
    dialect: "our.namespace.Dialect"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM