1、外文原文 CHAPTER 9 Writing Container-Managed Persistent Entity Beans In Chapter 8, we wrote a bean-managed persistent entity bean representing a bank account. In this chapter, well see how things change when we move to a container-managed model. With container-managed persistence, you dont implement any
2、 persistence logic in the entity bean itselfrather, the EJB container performs storage operations for you. As you will see, this greatly simplifies bean development. Before reading this chapter, you should be familiar with the entity bean concepts we covered in Chapter 7. Container-Managed Fields A
3、container-managed persistent entity bean allows the container to handle some or all of its data access logic. Rather than coding JDBC or SQL/J operations in your bean class, your container implicitly performs all database operations behind the scenes. With container-managed persistence, you must mak
4、e some of your entity bean classs fields public so that the container can set the fields when it performs database operations on behalf of your bean. The fields that you want to be persistent are called container-managed fields. You dont have to worry about setting these fieldsthe EJB container will automatically manipulate them for you behind the scenes when it performs storage operations. One restriction of container-managed fields is that every field you want to be managed by the conta