Matt Brown – Journeys of a software engineer

January 25, 2012

Database Reverse Engineering With Spring Roo

Filed under: Uncategorized — Tags: , , — mattbsoftware @ 11:51 pm

roo’s database-reverse command will not work out of the box because Spring doesn’t ship or make available an osgi driver for Roo due to licensing restrictions.
Pre-reqs

Reference

Instructions

  1. get this pom
  2. mvn install
  3. start roo and run the following commands

osgi install --url file://{maven repo}/javax/resource/com.springsource.javax.resource/1.5.0/com.springsource.javax.resource-1.5.0.jar
osgi install --url file://{maven repo}/javax/transaction/com.springsource.javax.transaction/1.1.0/com.springsource.javax.transaction-1.1.0.jar
osgi install --url file://{maven repo}/com/oracle/roo/jdbc/com.oracle.roo.jdbc.ojdbc5/11.1.0.7.0.0001/com.oracle.roo.jdbc.ojdbc5-11.1.0.7.0.0001.jar

osgi start --url file://{maven repo}/javax/resource/com.springsource.javax.resource/1.5.0/com.springsource.javax.resource-1.5.0.jar
osgi start --url file://{maven repo}/javax/transaction/com.springsource.javax.transaction/1.1.0/com.springsource.javax.transaction-1.1.0.jar
osgi start --url file://{maven repo}/com/oracle/roo/jdbc/com.oracle.roo.jdbc.ojdbc5/11.1.0.7.0.0001/com.oracle.roo.jdbc.ojdbc5-11.1.0.7.0.0001.jar

Connect Roo to Oracle DB

  • get into roo (‘roo>’) and execute the following

project --topLevelPackage --projectName --java 6
persistence setup --provider HIBERNATE --database ORACLE
database properties set --key database.url --value jdbc:oracle:thin:@:1526:
database properties set --key database.username --value
database properties set --key database.password --value

The fun part

Enter the following command, and lean back.

database reverse engineer –schema –package

Create a free website or blog at WordPress.com.