This wizard generates a set of container-managed persistence (CMP) entity beans from an existing database connection or schema. The IDE generates a CMP bean for each related table with CMP fields for each of the columns in the database tables. The IDE can also automatically generate finder methods for each of the CMP fields.
You open the wizard by right-clicking the project node or Enterprise Beans node for any EJB module project and choosing New > CMP Entity Beans from Database.
This page lets you select the location where you want to create the generated beans. You can also specify if you want the IDE to generate finder methods for CMP fields and if you want CMP and CMR fields added to the local interfaces.
In this page of the wizard you set the following:
Element | Description |
---|---|
Project |
Displays the project where the entity classes will be saved. This field is read only. |
Location |
Select the source folder where you want to create the classes. |
Package |
Select an existing package from the Package drop-down list or type the name of a new package. |
Generate Finder Methods for CMP Fields |
If selected, the IDE adds finder methods for all of the CMP fields. |
Add CMP and CMR Fields to Local Interfaces |
If selected, the IDE adds the CMP and CMR fields to local interfaces. |
When you click Finish, the IDE creates an entity bean for each of the selected tables and any tables the selected tables reference. You can see the generated entity beans in the EJB project node.
Related Topics
Developing Applications with NetBeans IDE,
Developing Applications with NetBeans IDE,
Developing Applications with NetBeans IDE,
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. |