Creating a JPA entity bean by adding persistence to a POJO
With the JPA Tools you to add persistence to plain old Java™ objects (POJOs)
About this task
To create a JPA entity bean:
Procedure
If you have not done so already, create a JPA project or
enable JPA support in an appropriate project. Ensure that an active
database connection is defined for the project.
Open the JPA perspective. (Click Window > Open Perspective > Other > JPA.)
Create a new Java class
(File > New > Class).
In the JPA Structure view, click the name of the class.
(If you want to work with another class, first double-click the class
in the Package Explorer view to show the class name in the JPA Structure
view).
In the JPA Details view, click the Map As drop-down
list and select from the following types of persistence to add to
the class:
For each attribute in your persistent class, you can specify
the mapping of the attribute. In this step, you define how each class
attribute maps to the database. In the JPA Structure view, click the
attribute that you want to map, and then in the JPA Details view,
click the Map As drop-down list. You can choose
the following types of mappings (see the Java Persistence
Tools User Guide for details on completing the fields) :