Grails应用程序在运行时不在数据库中创建表

时间:2016-04-27 18:12:22

标签: database oracle grails

我尝试设置我的grails应用,以便在run-app之后在数据库中创建下表。

class MyClass {

    String firstName
    String lastName

    static constraints = {
        firstName (blank: false)
        lastName  (blank: false)
    }
}a

我已将DataSource.groovy文件配置为连接到我的Oracle数据库。

dataSource {
    url = 'jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SERVICE_NAME=<SERVICE_NAME_URL>)))'
    username = 'wl_user'
    password = 'my_password'
    dbCreate = 'update'
    logSql = true
    driverClassName = 'oracle.jdbc.OracleDriver'
    dialect = 'org.hibernate.dialect.Oracle10gDialect'
    pooled = true
    properties {
        validationQuery = 'select 1 dbcp_connection_test from dual'
        testOnBorrow = true
        testOnReturn = true
        maxActive = 4
        maxIdle = 1
        initialSize = 0
    }
}

当我启动应用程序时,它似乎并没有创建。我有什么明显的遗失?

0 个答案:

没有答案