如何在Grails 3.0.1中设置hibernate方言

时间:2015-05-14 12:23:57

标签: hibernate grails gorm

我正在尝试新的Grails 3堆栈,我已经遇到了gorm / hibernate的障碍。我有自定义的hibernate方言来支持某些数据库功能,但#include <unistd.h> #include <stdlib.h> #include <signal.h> #include <stdio.h> int main() { pid_t pid; pid = fork(); if(pid == 0) { // child process setpgid(getpid(), getpid()); system("while true ; do echo xx ; sleep 5; done"); } else { // parent process sleep(10); printf("Sleep returned\n"); kill(-pid, SIGKILL); printf("killed process group %d\n", pid); } exit(0); } 文件中的方言设置似乎被忽略了:

var startTimeTextBox = $('#range_example_3_start');
var endTimeTextBox = $('#range_example_3_end');

$.timepicker.timeRange(
    startTimeTextBox,
    endTimeTextBox,
    {
        minInterval: (1000*60*60), // 1hr
        timeFormat: 'HH:mm',
        start: {}, // start picker options
        end: {} // end picker options
    }
);

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

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

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

此代码和设置在我工作的Grails 2.x.y项目中运行良好。

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

1 个答案:

答案 0 :(得分:2)

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

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

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

hibernate:
    dialect: "our.namespace.Dialect"
相关问题