Adding data using Java Persistence API (JPA)

Java™ Persistence API (JPA) is a specification for the persistence of Java objects to relational databases. JPA allows you to manage relational data in enterprise applications.

To create a Web page that accesses data using JPA technology:

  1. Create a dynamic Web project and activate the Java Persistence facet.

  2. Create JPA entity beans or Import JPA entity beans into a project.

  3. Configure JPA entity beans.

    1. Configure the Primary Key

    2. Configure Named Queries

    3. Configure Relationships

    4. Configure Concurrency Control

    5. Configure advanced options

  4. Create JPA manager beans.

  5. Configure JPA manager beans.

    1. Configure the Primary Key

    2. Configure Named Queries

    3. Configure Relationships

    4. Configure Concurrency Control

    5. Configure advanced options

  6. Create a Web page.

  7. Display the JPA data on a Web page, using JSF components, by dragging the JPA component from the Data and Services drawer on the palette onto the page, or by dragging the beans or methods from the Page Data View onto the page. For more information, refer to Creating page content using JSF components.

You can also generate JPA manager beans in EJB, Web or other projects. JPA manager beans provide you with a mechanism for creating, updating, deleting, and displaying information from your database using JPA.

For more information on adding data to Web applications using JPA, refer to the developerWorks® article Developing Web applications with the Java Persistence API and JavaServer Faces.

For more information on Java Persistence API, refer to the Help section Developing JPA applications.