Showing posts with label roo. Show all posts
Showing posts with label roo. Show all posts

Friday, June 10, 2011

roo reverse engineer

These are the steps I followed to have roo generate the database entities.
mkdir project
cd project
roo
In roo type the following to create a project along with the persistence layer.
project --topLevelPackage com.tecunhuman.example
persistence setup --provider HIBERNATE --database POSTGRES
exit roo and modify the file "src/main/resources/META-INF/spring/database.properties" to contain the correct information for the database. run roo again and execute:
database reverse engineer --schema schema-name
It will inspect the database and generate the DAO classes.

Thursday, June 9, 2011

Java rooing with xjc

I have been working on web services using java and found some useful tools to speed up development time. I have been using xjc to generate the web resource entities based on the provided schema. This program generates the classes used for the rest service along with the required annotations. Roo is another tool that generates code. It has an option to reverse engineer a database. This allows creating classes with annotations from an existing database. Our stack requires us to use java, spring and hibernate; roo allows creating entities with test in a fraction of the time.