New CMP Entity Beans from Database Wizard: Database Tables
See Also
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. You 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 Beans from Database.
This page of the wizard lets you select the tables for which you want
to generate beans. Use this page of the wizard as follows:
- Specify whether to generate the beans from a connection to a database
or from a database schema. When you select data source, the datasources for your
project are listed. You can add a new data source by selecting New Data Source from the
drop-down list and creating a data source from any of the database connections registered
in the Services window. When you generate entity beans from a data source,
the IDE also creates a database schema for the database and saves it in your
src/conf folder.
- Many database servers can only connect to one database at a time. Make
sure that your database server is not connected to any database other than
the one from which you want to generate the beans.
- Select any tables in the left pane and click the Add button.
Any tables related to selected tables are automatically added to the list in the right pane.
The IDE will also generate beans for each of the linked tables.
- Click Next.
- See Also
- New CMP Entity Beans from Database Wizard: Entity Beans Location
- About Entity Beans
- Generating CMP Entity Beans from a Database
- Defining a Finder Method
- Defining a Select Method
- Creating an EJB Module Project
- Creating an Enterprise Bean
Legal Notices