標籤:
- mvn appfuse:gen -Dentity=Name
為POJO產生CRUD。Name的值預設是${groupId}.model.Name。
自訂包路徑:
-Dentity=com.myproject.subpackage.model.Name
或者
-Dentity=~.subpackage.model.Name.
~代表 ${groupId}.
如果沒有指定Name值會有選擇選項。該命令會自動安裝,如果指定了-DdisableInstallation=true用下面的命令進行安裝
- mvn appfuse:install -Dentity=Name
- mvn appfuse:remove -Dentity=Name
移除dao的相關操作
- mvn appfuse:full-source
- mvn appfuse:gen-model
從資料庫中產生POJO對象
注意:
- 如果不使用給的GenericDao和GenericManager。修改pom.xml中的 <amp.genericCore>false</amp.genericCore>
- 外鍵的設定
If you have tables with foreign key ift‘s necessary to alter the template src/test/resources/appfuse/model/Ejb3PropertyGetAnnotation.ftl
<#lt/>${pojo.generateJoinColumnsAnnotation(property, cfg)} instead of
<#lt/>${pojo.generateJoinColumnsAnnotation(property)}
to generate @ManyToOne anotations
(It‘s necessary to do mvn appfuse:copy-templates first)
Don‘t forget to change this to read the identifier field from the other pojo
<form:select ... itemLabel="label" itemValue="value" >
in your WEB-INF/pages/entityform.jsp
appfuse-maven-plugin(AMP)