Developing entity beans with advanced concepts
In this section, we expand the banking application to describe how we might add the following new features to our beans:
Relationships
Inheritance
Custom query methods
EJB QL examples
Relational database mapping
As in the CMP persistent fields, the CMR relationship fields must also be mapped to an actual database element at deployment time, so that the concrete code can be generated. Therefore, each CMR field is mapped to a foreign key on the table that we are relating to.
Expanded banking entity requirements
The following are the new features that we will add to our banking system:
Support for new entity bean Account— This bean has the following persistent fields defined: accountID (primary key), ...
Get EJB 2.0 Development with WebSphere Studio Application Developer now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.