Generating CRUD with AMP

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Generating CRUD with AMP

Saeid
Hi Everybody!
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 and CategoryManager/CategoryManagerImpl Classes at least !!!

for example, in CategoryAction class there is the following code:
 private GenericManager<Category, Long> categoryManager;

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

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

thanks in advance.



Reply | Threaded
Open this post in threaded view
|

Re: Generating CRUD with AMP

mraible
Administrator
By default, AppFuse doesn't generate any DAOs because the Generic's-based DAO can be used. Why generate code if you don't have to? 

If you need to customize the DAO, then yes, you can generate them. Just use -DgenerateCore=true when you run "appfuse:gen". 

See http://appfuse.org/display/APF/AppFuse+Maven+Plugin and search for "genericCore" to see how to change this default behavior.

Hope this helps,

Matt

On Fri, Oct 10, 2014 at 12:24 AM, Saeid <[hidden email]> wrote:
Hi Everybody!
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 and
CategoryManager/CategoryManagerImpl Classes at least !!!

for example, in CategoryAction class there is the following code:
 private GenericManager<Category, Long> categoryManager;

and this is in Contradiction with the appfuse's standard tutorial ( Page
<http://appfuse.org/display/APF/Using+Hibernate>  )

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

thanks in advance.







--
View this message in context: http://appfuse.547863.n4.nabble.com/Generating-CRUD-with-AMP-tp4657335.html
Sent from the AppFuse - Dev mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Generating CRUD with AMP

Saeid
Dear Matt!
I Mean, Like the Tutorial , want to use Generic Core along with My Own Dao classes not Dao Core (as described here)
thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Generating CRUD with AMP

mraible
Administrator
If you want to generate the DAO classes, use the following:

appfuse:gen -Dentity=Person -Damp.genericCore=false

If you want to use your own DAOs that you've already created, simply modify the generated service classes to use your DAO instead.

Hope this helps,

Matt

On Oct 10, 2014, at 11:55 PM, Saeid <[hidden email]> wrote:

> Dear Matt!
> I Mean, Like the  Tutorial <http://appfuse.org/display/APF/Using+Hibernate>  
> , want to use /Generic Core/ along with /My Own Dao classes/ not Dao Core
> (as described  * <http://appfuse.org/display/APF/Using+Hibernate> here* )
> thanks!
>
>
>
> --
> View this message in context: http://appfuse.547863.n4.nabble.com/Generating-CRUD-with-AMP-tp4657335p4657338.html
> Sent from the AppFuse - Dev mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Generating CRUD with AMP

Saeid
thank you so much