But we don’t want to think in TABLES We want to think in CLASSES

We know we can map tables to bean classes, no problem. All the columns become persistent fields in the bean class, represented by abstract getters and setters, and we’re good to go. Except... if this were a class and not a table, we wouldn’t have designed it that way. We’d probably make the movie class a lot more friendly and useful, for example, so that a client could work with just the movie bean, rather than having to get references to all three beans.

image with no caption
image with no caption

Get Head First EJB 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.