簡體   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