3

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

另外,当我键入 database introspect --schema public --file schema.xml

Roo 告诉我命令 'database introspect --schema public --file schema.xml' 被发现但当前不可用(输入 'help' 然后 ENTER 了解此命令)

这是什么意思?我需要手动安装插件吗?

4

2 回答 2

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 
于 2017-08-03T06:29:00.137 回答
1

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

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

如果您尝试对 Oracle 数据库进行逆向工程,那么您将面临另一大麻烦,因为 Springsource 目前无法托管 OSGi 包装的 Oracle 驱动程序。

于 2011-02-17T13:56:09.670 回答