saeid
saeid

Reputation: 1

Generating CRUD with Appfuse Maven Plugin(AMP)

A few Days Ago I Used the Command mvn appfuse:gen to generate CRUD with the Appfuse. But it Generated the folllowing files/classes for a given class (say, Category):

1) Category-validation.xml

2) CategoryAction-validation.xml

3) CategoryAction.java

4) CategoryActionTest.java

5) CategoryForm.jsp

6) CategoryList.jsp

I Expected it will generate the CategoryDao/CategoryDaoHibernate or maybe CategoryManager/CategoryManagerImpl Classes at least !!! But I was wrong.

Instead, we have the following code in CategoryAction class:

private GenericManager categoryManager;

And this is in Contradiction with the appfuse's standard tutorial (See this Page)

Can anybody tells me how to generate the CategoryDao/CategoryDaoHibernate and CategoryManager/CategoryManagerImpl Classes for the project?

Upvotes: 0

Views: 370

Answers (2)

nenad
nenad

Reputation: 26

It's already explained in following post:

Stackoverflow: running “mvn appfuse:gen” does nothing but basically, it's the same like previous post from Matt Raible

After running that command (for EVERY entity), you'll get:

  • DAO layer
    • DAO interfaces
    • DAO (Hibernate) implementation
  • Service layer
    • Manager interfaces
    • Manager implementations
  • Webapp layer
    • Controllers (if you are using SpringMVC framework)
    • JSP pages

and whole bunch of all other required resources (various Resource Bundle properties, Spring XML files, Menu configurations...). Of course, it's all based on your model, your defined JavaBean classes.

After that, you just need to put some extra code inside implementation classes if you need some customized functionalities, some additional business logic.

I hope it helps.

Upvotes: 0

Matt Raible
Matt Raible

Reputation: 8644

Use -Damp.genericCore=false when you run appfuse:gen. Like the following:

mvn appfuse:gen -Dentity=Category -Damp.genericCore=false

Upvotes: 1

Related Questions