2010-11-16 42 views
3

我聽說過Roo DBRE插件,我認爲這是Roo提供的一個很棒的功能。不過,我無法在Google上找到有關Roo DBRE的任何文檔。我如何使用此功能? 我也檢查過這個JIRA票 https://jira.springframework.org/browse/ROO-1685 它說文檔被創建,所以我可以在哪裏找到它?如何在Roo 1.1.0 RELEASE中使用Spring Roo DBRE插件?

而且當我輸入 數據庫內省--schema公共--file schema.xml中

小豆告訴我 命令「數據庫反思--schema公共--file schema.xml中」被發現,但目前不可用(鍵入'help',然後回車,以瞭解關於此命令的信息)

這是什麼意思?我需要手動安裝附加組件嗎?

回答

1

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

您必須首先進行「持久性設置」,以便Roo知道要定位哪個DB。之後,在META-INF/spring/datapase.properties文件中配置連接(由「persistence setup」命令生成)。

如果您嘗試對Oracle數據庫進行反向工程,那麼您已經因爲Springsource目前無法託管OSGi封裝的Oracle驅動程序,所以又有了一大堆箍環可以跳過。

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