1、外文原文 CHAPTER 8 Writing Bean-Managed Persistent Entity Beans In Chapter 7, we covered some basic entity bean concepts. We learned that there are two kinds of entity beansbean-managed persistent and container-managed persistent. In this chapter, well demonstrate how to program bean-managed persistent
2、entity beans. When you code these types of entity beans, you must provide your own data access logic. You are responsible for providing the implementation to map your entity bean instances to and from storage. To do this, youd typically. use a database API such as JDBC or SQL/J. This is in stark con
3、trast to container-managed persistent entity beans, which have their data access handled for them by the EJB container. This chapter will teach you the basics of bean-managed persistence and show you how to build a simple bean-managed entity bean using JDBC. Implementation Guidelines for Bean-Manage
4、d Persistence In Chapter 7, we saw that all entity bean classesboth bean-managed persistent and container-managed persistentmust implement the javax.ejb.EntityBean interface. This interface defines callback methods that the container invokes on your beans. What you should put in these methods depends in part on whether you are using bean-managed persistence or container-managed persistence. Table 8.1 is a summary of what you should implement in each method, assuming your entity beans persi