Patterns and Idioms

This section presents some patterns and idioms that relate to CMP Entity beans. You'll recognize some of the points made here; they were made earlier in the “Container Managed Relationships” section.

Normalize/Denormalize Data in ejbLoad()/ejbStore()

Under CMP, the ejbLoad() and ejbStore() methods don't have very much (or indeed anything) to do; the interactions with the persistent data store are done by the EJB container.

However, it may be that the physical schema of the persistent data store (especially if that persistent data store is an RDBMS) does not correspond exactly with the logical schema of the Entity bean.

For example, the Applicant table defines two columns—address1 and address2. However, at least conceptually, ...

Get Sams Teach Yourself J2EE™ in 21 Days 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.