Spring Roo with MySQL (DB Reverse Engineering)

  • Be Noted: all the tables in the given schema, their primary key need to be auto_increment.
  • create project weddingMySQLRE 
  • persistence setup --provider HIBERNATE --database MYSQL --databaseName guestdb --userName root --password secret
  • change <property name="hibernate.hbm2ddl.auto" value="create"/> to <property name="hibernate.hbm2ddl.auto" value="update"/> in /src/main/resources/META-INF/persistence.xml
  • database introspect --schema guestdb 
  1. Located add-on that may offer this JDBC driver 
  2. 1 found, sorted by rank; T = trusted developer; R = Roo 1.1 compatible 
  • addon install id --searchResultId 01
  • database introspect --schema guestdb
  • database reverse engineer --schema guestdb --package ~.domain
  • controller all --package ~.web
  • add weddingMySQLRE project into server, and start server
  • http://localhost:8080/weddingMySQLRE
Thoughts: It's a little bit difficult to do DBRE on oracle, that's because Spring Roo does not provide OSGi drivers for Oracle and DB2. So we have to either obtain an OSGi-enabled driver or wrap the 
driver using Roo's wrapping facility. See the following links to see how to do it:

http://saber.b2b2000.com/display/BLUE/2011/01/26/Roo+reverse+engineering+on+Oracle