newguy
newguy

Reputation: 5976

How do I use Spring Roo DBRE add-on in Roo 1.1.0 RELEASE?

I've heard of the Roo DBRE add-on and I think it is a great feature provided by Roo. However I couldn't find any documentation on Google about Roo DBRE. How do I use this feature? I have also checked this JIRA ticket https://jira.springframework.org/browse/ROO-1685 and it said the documentation is created so where can I find it?

Also when I type database introspect --schema public --file schema.xml

Roo tells me Command 'database introspect --schema public --file schema.xml' was found but is not currently available (type 'help' then ENTER to learn about this command)

What does this mean? Do I need to manually install the add-on?

Upvotes: 3

Views: 1853

Answers (2)

Tharindu Jayasuriya
Tharindu Jayasuriya

Reputation: 394

I think you are missing one of the create project or jpa set up steps. First you have to create a project and then do jpa set up after that edit generated datapase.properties and do a database introspect. hint command will always guide you with the next step.

roo> project com.***.*****
Created ROOT/pom.xml
Created SRC_MAIN_RESOURCES
Created SRC_MAIN_RESOURCES/log4j.properties
Created SPRING_CONFIG_ROOT
Created SPRING_CONFIG_ROOT/applicationContext.xml 
roo> hint
Roo requires the installation of a persistence configuration,
for example, JPA.

For JPA, type 'jpa setup' and then hit TAB three times.
We suggest you type 'H' then TAB to complete "HIBERNATE".
After the --provider, press TAB twice for database choices.
For testing purposes, type (or TAB) HYPERSONIC_IN_MEMORY.
If you press TAB again, you'll see there are no more options.
As such, you're ready to press ENTER to execute the command.

Once JPA is installed, type 'hint' and ENTER for the next suggestion.

roo> jpa setup --provider HIBERNATE --database MSSQL 

Upvotes: 2

g051051
g051051

Reputation: 1041

docs are at http://static.springsource.org/spring-roo/reference/html/base-dbre.html.

You have to do a "persistence setup" first so that Roo knows what DB to target. After that, you configure the connection in the META-INF/spring/datapase.properties file (generated by the "persistence setup" command.)

If you'r trying to reverse engineer an Oracle database, then you've got another HUGE set of hoops to jump through, because Springsource currently can't host an OSGi wrapped Oracle driver.

Upvotes: 1

Related Questions