Creating JPA entity beans in a JPA-enabled web project from existing database tables
You can create JPA entity beans for a JPA-enabled web project by generating the beans from existing database tables.
Before you begin
Procedure
- In Enterprise Explorer, right-click your JPA-enabled web project and select The Generate Custom Entities wizard opens. .
- On the Select Tables page of the wizard, specify the connection name and the connection schema.
- In the Tables list, select the tables for which you want to generate entities.
- Click List generated classes in persistence.xml. This option enables automatic synchronization of the persistence.xml with any JPA resources in your workspace.
- Click Next
- On the Table Associations page of the wizard, click the + button to create an association. The Create New Association wizard opens.
- Create an association. Click Finish to exit the Create New Association wizard.
- Customize the default entity generation and click Next.
- Customize individual entities.
- Click Finish.