Pave Patterns

Jave EE CRUD Facade Pattern

Pattern Description

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:
  1. Open Java EE Perspective
  2. Create JPA enabled project.
  3. Create at least one JPA Entity
  4. In Project explorer select one JPA Entity and right click on it.
  5. Configure projects - EJB project must exist as prerequisite (create it using "new" button).
  6. Select CRUD Facade pattern
  7. Configure the session bean and the methods that will be generated.
  8. Select Finish.

Revert changes done by the pattern

  1. Delete the session bean and it's interfaces
  2. 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

  1. Open Java EE Perspective
  2. Create JPA enabled project.
  3. Create at least one JPA Entity
  4. In Project explorer select one JPA Entity and right click on it.
  5. Select CRUD Application pattern
  6. 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
  7. Configure the session bean and the methods that will be generated.
  8. Select Finish.
  9. Configure your server and DB
  10. publish

Revert changes done by the pattern

  1. Delete the session bean and it's interfaces
  2. If the entity is local and writable - delete the NamedQueries annotation
  3. Delete the web and ear project if they were generated by the pattern. If not see below.
  4. Delete the generated jsps and generated resources in resources folder.
  5. 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

  1. Create Plugin project
  2. Select Apply Pattern from the context menu on the project node.
  3. Select Create Pattern pattern.
  4. Modify names if needed.
  5. Select finish.

Revert changes done by the pattern

  1. Delete the Data Model Provider and Data Model Operation Class
  2. Delete the pattern declaration in plugin descriptor.
Incubation
Incubation