When implementing the method ejbCreate, the only thing you need to take into account is the data needed to create a new table record.In this case, all the parameters passed when the ejbCreate method is called must be passed to the associated CMP fields of the entity bean. You will implement this using the corresponding set methods. The EJB container then takes over the task of saving the record in the table.
|
You have created the entity bean QuickBookingBean. |
|
The structure of your project QuickCarRentalEjb is currently displayed in the J2EE Explorer. |
An editor appears, in which you can navigate to any of the bean’s components.
|
|
The Java Source Editor opens and displays the generated source code of the bean class.
The Outline view allows you to navigate quickly and easily. To navigate to the implementation of the method ejbCreate, simply click the method name in the Outline view.
|
|
setBookingId(bookingId); setReservationDate(reservationDate); setDateFrom(dateFrom); setDateTo(dateTo); setStatus(status); setVehicleTypeId(vehicleTypeId); setPickupLocation(pickupLocation); setDropoffLocation(dropoffLocation);
|
You have added calls of the set methods to the method ejbCreate of the bean class. The passed values can now be assigned to the associated CMP fields of the bean.
Implementing the Business Logic