2015-12-05 45 views
0

如何僅創建文件FILEVO_Roo_JavaBean.aj與Spring Roo shell 1.3.1.RC1 ??如何僅創建RooJavaBean文件FILEVO_Roo_JavaBean.aj

此命令生成許多文件:

roo> entity jpa --class com.model.vo.FileVO 

Created SRC_MAIN_JAVA\...\vo\FileVO.java 

Created SRC_MAIN_JAVA\...\vo\FileVO_Roo_Configurable.aj 

Created SRC_MAIN_JAVA\...\vo\FileVO_Roo_ToString.aj 

Created SRC_MAIN_JAVA\...\vo\FileVO_Roo_Jpa_ActiveRecord.aj 

Created SRC_MAIN_JAVA\...\vo\FileVO_Roo_Jpa_Entity.aj 

Created SRC_TEST_JAVA\...\vo\FileVODataOnDemand_Roo_DataOnDemand.aj 

Created SRC_TEST_JAVA\...\vo\FileVOIntegrationTest_Roo_IntegrationTest.aj 

~.model.vo.FileVO roo> Deleted SRC_TEST_JAVA\...\vo\FileVODataOnDemand_Roo_DataOnDemand.aj - empty 

Deleted SRC_TEST_JAVA\...\vo\FileVOIntegrationTest_Roo_IntegrationTest.aj - empty 

回答

0

難道你手工創建的.aj文件?這些文件由Spring roo管理,不應該由用戶修改(不創建)。

的命令序列創建實體應該是:

roo> entity jpa --class x.y.FileVO 
Created SRC_MAIN_JAVA/x/y/FileVO.java 
Created SRC_MAIN_JAVA/x/y/FileVO_Roo_Configurable.aj 
Created SRC_MAIN_JAVA/x/y/FileVO_Roo_Jpa_Entity.aj 
Created SRC_MAIN_JAVA/x/y/FileVO_Roo_Jpa_ActiveRecord.aj 
Created SRC_MAIN_JAVA/x/y/FileVO_Roo_ToString.aj 
~.FileVO roo> field string --fieldName name 
Updated SRC_MAIN_JAVA/x/y/FileVO.java 
Updated SRC_MAIN_JAVA/x/y/FileVO_Roo_Jpa_ActiveRecord.aj 
Created SRC_MAIN_JAVA/x/y/FileVO_Roo_JavaBean.aj 
~.FileVO roo> test integration 
Created SRC_TEST_JAVA/x/y 
Created SRC_TEST_JAVA/x/y/FileVODataOnDemand.java 
Created SRC_TEST_JAVA/x/y/FileVOIntegrationTest.java 
Created SRC_TEST_JAVA/x/y/FileVODataOnDemand_Roo_DataOnDemand.aj 
Created SRC_TEST_JAVA/x/y/FileVODataOnDemand_Roo_Configurable.aj 
Created SRC_TEST_JAVA/x/y/FileVOIntegrationTest_Roo_Configurable.aj 
Created  SRC_TEST_JAVA/x/y/FileVOIntegrationTest_Roo_IntegrationTest.aj 
~.FileVO roo> 

正如你所看到的,在需要的時候FileVO_Roo_JavaBean.aj創建:後FileVO具有第一場(這.aj生成getter和所以,如果類中沒有屬性,它將不會被生成)。

此外,我建議你更新到當前的Spring Roo的版本:1.3.2

祝你好運!