Introduction
If you follow the GORM rules for tables in your database, this should work great.
Install the plugin
grails install-plugin dbmapper
Generate the classes
grails generate-domain-classes
This will create JPA domain classes in your grails-app/domain directory along with a hibernate.cfg.xml file within grails-app/conf/hibernate.
Modify your DataSource
You need to modify your main DataSource definition to support annotated Hibernate classes:
configClass = GrailsAnnotationConfiguration.class
Doesn't support clob/blob yet?
Please, where can we find a boil down of the GORM rules ? Or another document referring to the rules for the mapping from an existing database using Grails ?
Thanks in advance.
please help, this seems not to be working for me.
In STS using Grails 1.3.7 I get the following error when running "grails generate-domain-classes":
Running script /Users/d054048/.grails/1.3.7/projects/GoverNestor?/plugins/dbmapper-0.1.7/scripts/GenerateDomainClasses?.groovy Error executing script GenerateDomainClasses?: null/scripts/Compile.groovy (No such file or directory) java.io.FileNotFoundException?: null/scripts/Compile.groovy (No such file or directory)
Error executing script GenerateDomainClasses?: null/scripts/Compile.groovy (No such file or directory)