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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.