
In the deployment descriptor persistent.xml, you will enter the data source that points to the entity bean. You will also map the entity bean and the associated CMP fields to the table and its columns.
|
|
The structure of your project QuickCarRentalEjb is currently displayed in the J2EE Explorer. |
Specifying the general properties
The Developer Studio opens a multipage editor, which allows you to enter persistent properties in the standard deployment descriptor persistent.xml.
|
|
These entries are automatically added to the XML source at the appropriate point.
<persistent-ejb-map> <locking type="Table"/> <db-properties> <data-source-name>CAR_RENTAL_POOL</data-source-name> <database-vendor name="SAPDB"/> </db-properties> ...
Assigning a table to the entity bean
In the right pane, input fields appear where you can assign the table.
You can assign the table in the wizard that appears.
|
|
Mapping CMP fields to table fields
The assignment is confirmed with an output line The column is verified by the data dictionary.
|
|
Map the fields and table columns as follows:
|
CMP field |
Table column |
|
vehicleTypeId |
VEHICLETYPEID |
|
reservationDate |
RESERVATIONDATE |
|
dateFrom |
DATEFROM |
|
dateTo |
DATETO |
|
pickupLocation |
PICKUPLOCATION |
|
dropoffLocation |
DROPOFFLOCATION |
|
status |
STATUS |
You have entered all the bean-specific descriptions that your application needs in the J2EE deployment descriptor persistent.xml.
Next step: