O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accessing an Entity Bean

As we know, an entity bean is an EJB that represents a unique instance of an entity in a permanent data store. Each entity bean is represented by a unique ID: a primary key. Unlike session beans, which are usually created for use, an entity bean represents persistent data and is therefore usually found and retrieved from the data store.

The previous example showed the use of JDBC in a helper object for a session bean. The helper object implemented the Data Access Object (DAO) design pattern, which isolates and encapsulates the data access activity into a coarse-grained object. By using this design pattern, the details of the data and the data access are isolated from the session facade bean.

DAOs can also have utility ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required