Creating a New Project


This quick start shows how to create a new Java Persistence Entity project. Before creating the project, you should open the new Persistence perspective.

  1. Switch to the new Persistence Perspective to begin working with Java persistence entities. Select Window > Open Perspective > Other. The Select Perspective Dialog appears.

    Selecting Persistence Perspective

    This figure shows the Window > Open Perspective > Other option from the menu.
  2. On the Select Perspective dialog, select Persistence and click OK. The workbench adds the Persistence Outline and Persistence Properties views.

    Select Perspective Dialog

    This figure shows the Select Perspective dialog with the Perspective option selected.

Now, we will create a new Java project.

  1. Select File > New > Project. The New Project dialog appears.

  2. On the New Project dialog, select Java Project and click OK. The Create a Java Project dialog appears.

  3. On the Create a Java Project dialog, enter a Project name and click Next. The Java Settings dialog appears.

  4. On the Java Settings dialog click Finish. Eclipse adds the project to the workbench and opens the Java perspective.

Finally, we will "add persistence" to the project.

  1. Right-click the Java project in the Explorer and select Persistence > Add Persistence. The Add Persistence Dialog appears.

  2. On the Add Persistence Dialog select a database connection (or create a new connection, using the WTP RDB) and click Finish.


    Note:

    You must be connected to the database before adding persistence to the project. You will also need to create a table named ADDRESS (you will add its columns later).

    Add Persistence Dialog

    The Add Persistence dialog.
  3. You can now work in the Persistence Perspective.

Now that you have created a project with persistence, you can continue with Creating a Java Persistent Entity.