Oct 28th, 2011, 10:34 AM
How to forward engineer Schema in Roo?
In Grails there is a feature which helps in Forward Engineering Schema for Domain Model Objects. I saw DBRE add on which helps in keeping Domain Model and Database Schema in Sync but does not tell you how to forward engineer the DB Schema from Domain Model?
Can someone please tell me how to forward engineer DB Schema in Roo?
Dec 26th, 2011, 10:05 AM
I have figured out a solution for this. One can use hibernate ddl plugin for this, may be the inventors of Roo thought there are such plugins available for Schema forward generation so why waste time re inventing the wheel so they focused on the Spring DBRE plugin which syncs up the Object model with Data model.
To describe the solution add these snippets to your pom.xml
The above pom is for schema generation in my sql database you can change it to the DB of your liking.
Run the MVN command:
The ddl can be seen in target/hibernate3/sql/schema.ddl
Incase you want to change it to some other Database modify your persistence.xml
<property name="hibernate.dialect" value="Provide your hibernate dialect for DB" />