- appfuse:gen-model:根据数据库的表生成java类
- appfuse:gen: 根据 POJOs.生成并安装 Tests, DAOs, Managers, Controllers and Views
- appfuse:remove: 删除appfuse:gen.生成的代码
- appfuse:full-source: Converts AppFuse basic projects to full-source with no AppFuse dependencies. Also renames packages to match your project's groupId.
In the pom.xml, insert this segment.
xml 代码
- <project>
- ...
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo<!---->groupId>
- <artifactId>appfuse-maven-plugin<!---->artifactId>
- <version>2.0<!---->version>
- <configuration>
- <genericCore>true<!---->genericCore>
- <fullSource>false<!---->fullSource>
- <!---->configuration>
- <dependencies>
- <dependency>
- <groupId>${jdbc.groupId}<!---->groupId>
- <artifactId>${jdbc.artifactId}<!---->artifactId>
- <version>${jdbc.version}<!---->version>
- <!---->dependency>
- <!---->dependencies>
- <!---->plugin>
- <!---->plugins>
- <!---->build>
- ...
- <!---->project>
File<o:p></o:p> |
Comment Replaced<o:p></o:p> |
Web Framework<o:p></o:p> |
src/main/webapp/WEB-INF/applicationContext.xml<o:p></o:p> |
<!----><o:p></o:p> |
All<o:p></o:p> |
src/main/webapp/WEB-INF/applicationContext.xml<o:p></o:p> |
<!----><o:p></o:p> |
All<o:p></o:p> |
core/src/main/resources/applicationContext.xml<o:p></o:p> |
<!----><o:p></o:p> |
All<o:p></o:p> |
core/src/main/resources/applicationContext.xml<o:p></o:p> |
<!----><o:p></o:p> |
All<o:p></o:p> |
src/main/webapp/WEB-INF/faces-config.xml<o:p></o:p> |
<!----><o:p></o:p> |
JSF<o:p></o:p> |
src/main/webapp/WEB-INF/faces-config.xml<o:p></o:p> |
<!----><o:p></o:p> |
JSF<o:p></o:p> |
src/main/webapp/WEB-INF/dispatcher-servlet.xml<o:p></o:p> |
<!----><o:p></o:p> |
Spring MVC<o:p></o:p> |
src/main/webapp/WEB-INF/applicationContext.xml<o:p></o:p> |
<!----><o:p></o:p> |
Struts<o:p></o:p> |
src/main/resources/struts.xml<o:p></o:p> |
<!----><o:p></o:p> |
Struts<o:p></o:p> |
生成 CRUD 用 AMP
In the AppFuse 2.0 M5 release, you can run the following command to generate
CRUD screens/classes for a POJO:
appfuse:gen -Dentity=Name
If you don't specify the entity name, you're prompted for it. After generating
the code, you can install it using:
appfuse:install -Dentity=Name
Your entity must be defined in your hibernate.cfg.xml file for this to work.
In a modular project, these commands must be run in the "core" and "web"
modules. The plugin is smart enough to figure out when it should/should not
generate stuff based on the packaging type (jar vs. war). In a future release,
we hope to combine "gen" and "install" into a single command.
The Maven Hibernate3 Plugin has seven goals.
* hibernate3:hbm2cfgxml: Generates hibernate.cfg.xml
* hibernate3:hbm2ddl: Generates database schema.
* hibernate3:hbm2doc: Generates HTML documentation for the database
schema.
* hibernate3:hbm2hbmxml: Generates a set of hbm.xml files
* hibernate3:hbm2java: Generates Java classes from set of *.hbm.xml files
* hibernate3:schema-export: Creates SQL DDL file and generates the
database schema from set of *.hbm.xml files
* hibernate3:schema-update: Updates the database schema based on the set
of *.hbm.xml files