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

Entity Beans: The MoviesEntityBean Class

The MoviesEntityBean class provides an entity bean wrapper for the MoviesDAO class, which implements the DAO design pattern. As with previous examples, the details of the data access are encapsulated in the DAO. The implementation of the entity bean class merely maps the entity bean methods called by the application server (the callback methods) to the appropriate MoviesDAO methods. The code listing for the class declaration and findByPrimaryKey method is shown next.

The MoviesEntityBean Class Declaration and findByPrimaryKey Method
 package movies.ejb; import javax.ejb.*; import java.rmi.*; import java.io.Serializable; import java.sql.*; import javax.sql.*; import javax.naming.*; import db.*; import jdbcutil.*; ...

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