From 4a1176558e26b7ddd5ebe67488ca03e9abf3bb95 Mon Sep 17 00:00:00 2001 From: nhauge Date: Wed, 24 Sep 2008 03:25:55 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'v200809230002'. --- jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm | 156 ---------------------- 1 file changed, 156 deletions(-) delete mode 100644 jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm (limited to 'jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm') diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm deleted file mode 100644 index 530bf91bba..0000000000 --- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm +++ /dev/null @@ -1,156 +0,0 @@ - - - - - -Creating a JPA Entity - - - - - - - - - - - - - - - -

-
-

Creating a JPA Entity

-

Use this procedure to create a JPA entity:

-
    -
  1. -

    From the Navigator or Package Explorer, select the JPA project and then File > New > Other. The Select a Wizard dialog appears.

    -
    -

    Selecting the Create a JPA Entity Wizard

    -The Select a Wizard dialog with Entity selected.
    -
  2. -
  3. -

    Select Entity and then click Next. The Entity Class page appears.

    -
    -

    The Entity Class Page

    -The Entity Class page of the Create a JPA Entity wizard.
    - -

    Complete this page as follows:

    -
      -
    • -

      Select the JPA project in the Project field.

      -
    • -
    • -

      In the Source Folder field, select, or enter, the location of the JPA project's src folder.

      -
    • -
    • -

      Select, or enter, the name of the class package for this entity in the Java Package field.

      -
    • -
    • -

      Enter the name of the Java class in the Class name field.

      -
    • -
    • -

      If needed, enter, or select a superclass.

      -
    • -
    • -

      If needed, complete the Inheritance section as follows (these properties are optional):

      -
        -
      • -

        Accept the Entity option (the default) to create a Java class with the @Entity option.

        -
      • -
      • -

        Alternatively, select Mapped superclass (if you defined a super class).

        -
      • -
      • -

        Select Inheritance and then select one of the JSR 220 inheritance mapping strategies (SINGLE_TABLE, TABLE_PER_CLASS, JOINED).

        -
      • -
      • -

        Select Add to entity mappings in XML to create XML mappings in orm.xml, rather than annotations.

        -
      • -
      -
    • -
    -
  4. -
  5. -

    Click Next to proceed to the Entity Properties page where you define the persistent fields for the entity.

    -
    -

    The Entity Properties Page

    -The Entity Properties page of the Create JPA Entity wizard.
    - -

    Alternatively, click Finish to complete the entity.

    -
  6. -
  7. -

    Complete the page as follows:

    -
      -
    1. -

      If needed, enter a new name for the entity. Doing so results in adding a name attribute to the @Entity notation (@Entity(name="EntityName")).

      -
    2. -
    3. -

      Accept Use default (the default setting) to use the default value for the name of the mapped table. Entering a different name results in adding the @Table notation with its name attribute defined as the new table (@Table(name="TableName")).

      -
      -

      - - - - - - -
      -

      Note:

      -The Entity Name-related options are not available if you selected Mapped superclass on the Entity Class page
      -
      -
      -
    4. -
    5. -

      Add persistence fields to the entity by clicking Add. The Entity Fields dialog appears.

      -
      -

      The Entity Fields Dialog

      -The Entity Fields dialog.
      -
    6. -
    7. -

      Select a persistence type from the Type list. You can retrieve additional types using the Browse function.

      -
    8. -
    9. -

      Enter the field name and then click OK. Repeat this procedure for each field.

      -
    10. -
    11. -

      If needed, select Key to designate the field as a primary key.

      -
    12. -
    13. -

      Select either the Field-based access type (the default) or Property-based access type.

      -
    14. -
    -
  8. -
-

 

-Related reference
-
-Create JPA Entity wizard
-Create New JPA Project wizard
-JPA Development perspective -

 

-Related tasks
-
-Managing the persistence.xml file
-Adding persistence to a class -

 

-Related concept
-
-Understanding Java persistence
-The persistence.xml file
-

 

-
- - - - - - -- cgit v1.2.3