Creating JPA projects

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

About this task

To create a JPA project:

Procedure

  1. In the JPA perspective, click File > New > Project > 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. Select he JPA version to use in the project.
  6. Under Configurations, select Minimal Configuration
  7. 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 is 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.
  8. Click Next.
  9. Optional: Select source folders on the build path or add more by clicking Add Folder, set the default output folder, or leave the default. Click Next.
  10. On the JPA facet page, do the following steps:
    1. Select the proper platform.
    2. Select the Library Provided by Target Runtime type in JPA implementation.
    3. 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.
    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 that are specified in Java™ classes through JPA annotations. The orm.xml file is in the META-INF directory for the project.
  11. Click Finish.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: t_jpa_project_create.html