Chitika

Monday, September 2, 2013

grails db-reverse-engineer

Create application:

> grails create-app

Reverse engineer DB, following is the great tutorial for it:

http://grails-plugins.github.io/grails-db-reverse-engineer/docs/manual/guide/single.html

> grails db-reverse-engineer

Remember following points:

1. every thing in db should be in small case, separating words with underscore ("_"), instead of camel notation.
2. when joining tables, foreign key should be named as follows: table_name + underscore + id, e.g. foreign key for table "data" should be named: data_id, in all the tables joined with data table

Generate controllers:

> grails generate-all "*"

Run application:

> grails run-app

NOTE: if error occurred, set JDK path:

> export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:jre/bin/java::")

No comments:

Post a Comment