You can use Java™ EE 5 annotations to create an entity
bean and add it to your project.
You need to have a Java project or an EJB project created.
To create an entity bean within your EJB project:
- In the Java EE perspective, click . The
Create a New Java Class wizard opens.
- In the Source folder field, select the source
folder for the new bean.
- In the Package field, type the package name
for the new bean.
- Click Finish.
- In the Java class editor, underneath the package declaration,
type @Entity. You can see an error / quick fix icon
beside the @Entity line.
- Right click the quick fix icon and select Quick Fix.
The options to correct the problem display.
- Select Import javax.persistence.Entity,
press CTRL+S to save, and the dependencies are added to your Java class.