mysql - Grails or Hibernate not creating missing table -


I am new to Grails, so please forgive my ignorance - if other information is useful, then I get it Do your best to post.

I have created a single domain model class ToolKitComponent which is defined: ToolCitComponent {String componentName String componentVersion int componentDownloads date compnentLastUpdate Static constraints = {}} I have an administrator who wants to test ORM by making an example, so here is the content of the controller:

  Def Index () {ToolKitComponent i = new ToolKitComponent () i.setComponentName ("TestComponent") i.setComponentVersion ("v1.10") i.setComponentDownloads (1) i.setCompnentLastUpdate (new date) i .save ( }}   

I have installed the MySql database plug-in and updated My DataSource.groovy:

  data source {pooled = true driverClassName = "Com.mysql.jdbc.Driver" dialect = "org .hibernate.dialect.MySQL5InnoDBDialect "logg IngSql = true} // other settings environment {development {dataSource {String dbCreate =" create "string url =" jdbc: mysql: // localhost / testDataBase "string user name =" myUser "string Password = "myPass"}}}   

I created the database testDataBase and gave the username to everyone.

When I run the application, I get:

  Enter hibernate: tool_kit_component (version, comp_list_update, component_download, component_name, component_version) value (?,? ,?,?,?). Error 2012-07-11 20: 01: 52772 [http-bio-8080-exec-2] Error Usage JDBC EXPRESS REPORTER - Table "TOOL_KIT_COMPONENT" was not found; SQL statement: Enter the values ​​in tool_kit_component (version, compnent_last_update, component_downloads, component_name, component_version) (?,?,?,?,?) [42102-164] | Error 2012-07-11 20: 01: 52,752 [http-bio-8080-exec-2] Error Errors. Grace AppreciationSolar - JDBCSXclation generated while requesting the request: [GET] / testprose / table "TOOL_KIT_COMPONENT" was not found; Enter the SQL statement: tool_kit_component (version, compnent_last_update, component_downloads, component_name, component_version) value (?,?,?,?,?) [42102-164] Stacktrace is as follows: Message: Table "TOOL_KIT_COMPONENT" was not found; Enter the SQL statement: tool_kit_component (version, compnent_last_update, component_downloads, component_name, component_version) value (?,?,?,?,?) [42102-164] line | Method - & gt; & Gt; 32 9 GetJdbcSQLException - Or -> - - - - - - - - - - - - 16 9 Go in '' | 146 | get . . . . . . . . '' | 4753 | Org.h2.com Mind. ReadTableOrView | 4731 | ReadTableOrView '' | 954 | '' In. 375 | ParsePrepared . '' | 279 | '' In Pars | 251 | Pars . . . . . '' | 217 | Prepare '' in. 415 | Preparation Local . Org.h2.engine.Session | 364 | Prepare '' in. 1121 | Ready Comand Org.h2.jdbc.JdbcConnection | 71 | & Lt; Init & gt; Org.h2.jdbc.JdbcPreparedStatement | In 267 | Prepared position in Org.h2.jdbc.JdbcConnection | 1051 | Ready '' in Position | 508 | Org.apache.commons.dbcp.DelegatingConnection | 400 ORG.apache.commons.dbcp.PoolingDataSource $ PoolGuardConnectionWrapper 11 | Index . . . . . TestProject.HomeController | 1110 | Run worker in Java.util.concurrent.ThreadPoolExecutor | 603 | Run . . . . . . . ^ 722 in Java.util.concurrent.ThreadPoolExecutor $ employee.   

I am using Grails 2.0.4.

Any help is appreciated!

Remove string in your data source definition environment {development {datasource {dbCreate = "create" url = "jdbc: mysql: // localhost / testDataBase" user name = "myUser" password = "myPass"}}}

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -