0

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?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
saeid
  • 1
  • 4

2 Answers2

1

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

mvn appfuse:gen -Dentity=Category -Damp.genericCore=false
Matt Raible
  • 8,187
  • 9
  • 61
  • 120
0

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.

Community
  • 1
  • 1
nenad
  • 26
  • 5