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.*; ... |
Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software 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.