12.4. Entity EJBs and nonflat data structures

A ‘flat’ data structure is one in which the all the relevant entities are collated into one searchable unit, such as a single database table or a single directory suffix. In many applications, the underlying data structure is not flat; it may be that a given EJB models data in different database tables, or even in different data sources.

When using bean-managed persistence, there is no reason why an entity EJB’s data should not be drawn from a number of different database tables. Indeed, a prominent advantage of entity EJBs is that they can provide a simple, object-oriented view of a complex underlying data model. All that is necessary is that the developer have a sufficiently good grasp of SQL to ...

Get Applied Enterprise JavaBeans™ Technology 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.