Grails Database Reverse Engineering Plugin
Support for database migrations and reverse engineering are two related features that we’ve scheduled for Grails 1.4/2.0 (see the roadmap wiki page
for the others). The migration support will be based on Liquibase
and there’s already a plugin for that
so I started looking at reverse engineering first.
Work progressed faster than I expected (thanks to the features of the Hibernate Tools library and all of the time I spent digging into its internals for the App Info
plugin) and it didn’t depend on any new features in 1.4 (not yet anyway) so I released the plugin
yesterday so users can started using it now. Install it the usual way:
and refer to the documentation for configuration options.
I tested this with MySQL and Oracle, and other databases that Hibernate supports should work too. There’s a tutorial in the documentation that uses MySQL, and you can use the Chinook database to test with Oracle. I used these settings (in
grails-app/conf/Config.groovy
) for the Chinook database:
grails.plugin.reveng.packageName = 'com.codeplex.chinookdatabase' grails.plugin.reveng.defaultSchema = 'CHINOOK' grails.plugin.reveng.manyToManyBelongsTos = [PLAYLISTTRACK: 'PLAYLIST']
and these datasource settings (in grails-app/conf/DataSource.groovy
)
dataSource { url = 'jdbc:oracle:thin:@localhost:1521:orcl' driverClassName = 'oracle.jdbc.driver.OracleDriver' username = 'chinook' password = 'p4ssw0rd' dialect = org.hibernate.dialect.Oracle10gDialect }
Try it out and report any issues on the Grails user mailing list or in JIRA
.
One related thing I wanted to point out is that the work to replace HSQLDB with H2



http://localhost:8080/appname/dbconsole
in a browser (JIRA issue here
[…] información sobre Grails Database Reverse Engineering Plugin (traducido al […]
[…] An Army of Solipsists » Blog Archive » Grails Database Reverse Engineering Plugin […]
Hi, Burt
I guess you should change “the documentation” link to
https://github.com/grails-plugins/grails-db-reverse-engineer.
Cheers,
Thanks, fixed.
I am having a lot of trouble getting the Hibernate Tools installed for various reasons (Indigo not supported yet, getting exceptions in Helios).
Do you have recommendations for how to get this to work from command line?
I get the following error when trying to install this plugin from the command line: http://screencast.com/t/6fAPjJI81wW. I have not been able to find a good download source for these dependencies and wish they were automatically included by the install plugin command.
I tried “grails install-plugin db-reverse-engineer” but got a few “unresolved dependencies”:
:: org.hibernate#hibernate-tools;3.2.4.GA: not found
:: freemarker#freemmarker;2.3.8: not found
:: org.beanshell#bsh;2.0b4: not found
:: org.hibernate#jtidy;r8-20060801: not found
I am using Groovy 1.8, Grails 1.3.7. Any idea how to fix this?
Thanks!
Alex
@Kyle @Alex,
I think uncommenting mavenCentral() from BuildConfig.groovy will allow you to pull down the dependencies.
thank you,ncommenting mavenCentral() and then install the plugin will be Ok.