Creating JPA projects

You can use the New JPA Project wizard to create and configure a new JPA project.

About this task

To create a JPA project:

Procedure

  1. In the JPA perspective, click File > New > Project > JPA > JPA Project.
  2. In the Project Name field, type a name for the new project.
  3. To change the default project location, clear the Use default check box under Project contents and select a new location with the Browse button.
  4. In the Target runtime field, select the target runtime environment for the project. This field is disabled if you previously created a project and set a target runtime environment.
  5. Under Configurations, select one of the following configurations:
    • Minimal JPA 2.0 Configuration if you want to use JPA 2.0 in your project.
    • Minimal JPA 1.0 Configuration if you want to use JPA 1.0 in your project.
  6. Optional: To add the new project to an enterprise application (EAR) file, select the Add module to an EAR application check box. Type a new project name or select an existing enterprise application project from the EAR Project Name list. Or, click New to start the New EAR Application Project wizard.
    Note: If you type a new EAR project name, the EAR project will be created in the default location with the lowest compatible J2EE version based on the version of the project being created. If you want to specify a different version or a different location for the enterprise application, you must use the New Enterprise Application Project wizard.
  7. Click Next.
  8. Optional: Select one or more additional project facets from the list. The required facets for a JPA project are automatically selected and cannot be cleared. To specify server runtime environments, click Show Runtimes and select one or more runtime environments. Save your custom configuration and then click Next.
  9. On the JPA facet page, do the following steps:
    1. If you are using the WebSphere® Application Server v6.1 or v7.0 runtime environment, ensure that RAD JPA 2.0 Platform or RAD JPA 1.0 Platform is selected as the Platform.
    2. Select the appropriate database connection for this project, or click Add Connection to create a new one.
      Note: You must have an active database connection to map entities to database tables or to generate JPA entities from an existing database.
    3. Select Use Implementation provided by server runtime.
    4. For Persistent class management, select whether you want annotated classes to be discovered automatically by the runtime environment or if they must be listed in the persistence.xml file.
    5. If you want to automatically create the file orm.xml, select Create orm.xml. You can use the orm.xml file to override object-relational mapping details specified in Java™ classes through JPA annotations. The orm.xml file is located in the META-INF directory for the project.
  10. Click Finish.

Feedback