Anatomy of a Simple Entity EJB

We now know how to object an instance of an EJB. But how was it created in the first place? We've seen part of this picture already with our discussions of the home and remote interfaces. But there are two other Java classes we need as well: the bean's actual implementation and a class representing the bean's primary key. We'll examine these two classes in detail in a moment, but before we do, let's step back and examine the home and remote interfaces for an actual example.

Note

For the remainder of this chapter we will be developing a simple Bean-Managed Persistence EJB that works as an alarm clock and stores alarm settings. Most of the files associated with this example will have names starting with Alarm.

Get XML Development with Java™ 2 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.