Persistent entity


An Entity is a persistent domain object.

An entity can be:

An entity must have:

Each persistent entity must be mapped to a database table and contain a primary key. Persistent entities are identified by the @Entity annotation.

Use this procedure to add persistence to an existing entity:

  1. Right-click the class in the Package Explorer and select Java Persistence > Make Java Persistence Entity.

    Adding Persistence to a Class

    Using the Persistence > Make Java Persistent Entity menu option.
  2. In the Persistence Properties view, use the Map As drop-list to select Entity.

    Selecting Entity Persistence

    Selecting entity persistence on the Persistence Properties view.
  3. Complete the remaining Persistence Properties view (for entities).

 

Related tasks

Adding persistence to a class