如何在Roo 1.1.0 RELEASE中使用Spring Roo DBRE插件?

时间:2010-11-16 01:12:19

标签: spring-roo

我听说过Roo DBRE插件,我认为这是Roo提供的一个很棒的功能。但是我在Google上找不到关于Roo DBRE的任何文档。我该如何使用此功能? 我也检查过这张JIRA票 https://jira.springframework.org/browse/ROO-1685 它说创建了文档,我在哪里可以找到它?

当我打字的时候 数据库内省--schema public --file schema.xml

罗告诉我 找到了命令'database introspect --schema public --file schema.xml'但当前不可用(键入'help'然后输入ENTER以了解此命令)

这是什么意思?我是否需要手动安装附加组件?

2 个答案:

答案 0 :(得分:2)

我认为你缺少一个创建项目或jpa设置步骤。 首先,您必须创建一个项目,然后在编辑生成的datapase.properties之后进行jpa设置并进行数据库内省。提示命令将始终指导您完成下一步。

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 

答案 1 :(得分:1)

文档位于http://static.springsource.org/spring-roo/reference/html/base-dbre.html

首先必须执行“持久性设置”,以便Roo知道要定位的数据库。之后,在META-INF / spring / datapase.properties文件中配置连接(由“persistence setup”命令生成。)

如果你试图对Oracle数据库进行逆向工程,那么你还有另一个巨大的环节可以跳过,因为Springsource目前无法托管一个OSGi包装的Oracle驱动程序。

相关问题