This pattern aims to aid the application developer in creating a Session CRUD Faceade out of existing JPA Entity.
The pattern will take into account the attributes and the relations of the JPA Entities and will generate a single Session Bean with CRUD methods.
It will also generate queries. Static or dynamic, depending on wheather the JPA Entity is wriatable for the developer.
Apply Pattern Procedure
To apply the pattern you have to:
Open Java EE Perspective
Create JPA enabled project.
Create at least one JPA Entity
In Project explorer select one JPA Entity and right click on it.
Configure projects - EJB project must exist as prerequisite (create it using "new" button).
Select CRUD Facade pattern
Configure the session bean and the methods that will be generated.
Select Finish.
Revert changes done by the pattern
Delete the session bean and it's interfaces
If the entity is local and writable - delete the NamedQueries annotation
Jave EE CRUD Application Pattern
Pattern Description
This pattern extends the functionality of CRUD Session pattern. This pattern will generate a JSF UI on top of the Session CRUD Facade.
The pattern will:
generate or use an existing EJB, dynamic web project and Enterprise Archive Project.
generate Session CRUD Facade in EJB project
generate MBeans that use the CRUD Facade
generate required references for the projects and to the default JSF provider
registers MBeans into faces-config.xml
generate JSF front end that uses the MBeans
defines navigation rules for the jsps into faces-config.xml
will register start page in web.xml
Apply Pattern Procedure
Open Java EE Perspective
Create JPA enabled project.
Create at least one JPA Entity
In Project explorer select one JPA Entity and right click on it.
Select CRUD Application pattern
Configure projects - EJB project must exist as prerequisite (create it using "new" button), while web and ear projects can be reused or generated on finish
Configure the session bean and the methods that will be generated.
Select Finish.
Configure your server and DB
publish
Revert changes done by the pattern
Delete the session bean and it's interfaces
If the entity is local and writable - delete the NamedQueries annotation
Delete the web and ear project if they were generated by the pattern. If not see below.
Delete the generated jsps and generated resources in resources folder.
In web.xml remove the welcome page that is pointing to start.jsp
Create Pattern Pattern
Pattern Description
Pattern that will generte pattern skeleton in PDE project. This pattern aims to aid plugin developers, that wish to extend their functionality using the Pave Framework.
The pattern will generate an initial skeleton for creating of a pattern. It will generate basic Data Model Provider, Operation and plugin.xml declaration.
Apply Pattern Procedure
Create Plugin project
Select Apply Pattern from the context menu on the project node.
Select Create Pattern pattern.
Modify names if needed.
Select finish.
Revert changes done by the pattern
Delete the Data Model Provider and Data Model Operation Class
Delete the pattern declaration in plugin descriptor.