classes) when it s a (Web hosting provider) good time to read
classes) when it s a good time to read and write data to the database. The persistent instances perform the reading and writing in a way that is optimized for the database being used. The persistent classes will include database access logic tailored to a particular database. For example, an EJB product might provide a container that can map an entity beans to a specific database like the Oracle relational database or the POET object database. This specificity allows the persistent classes to employ native database optimizations particular to a brand or kind of database, schema, and configuration. Persistent classes may employ other optimizations like lazy loading and optimistic locking to further improve performance. The container tool generates all the database access logic at deployment time, which it imbeds in the persistent classes. This means that the bean developers do not have to write this database access logic themselves, saving them a lot of work, and can also results in better performing entity beans because they are optimized implementations. As an entity bean developer, you will never have to deal with any database access code when working with CMP 2.0 entities. In fact, you won t have access to the persistent classes that contain that logic because they are generated by container tool automatically. In most cases, the source code is not available to the bean developer. Figures 7-2 and 7-3 show different container tools both of which are being used to map the Customer entity bean to a relational database. [Figure 7-2 need screen shot] BEA s Weblogic deployment tool [Figure 7-3 need screen shot] Sun Microsystem s J2EE RI deployment tool The Customer EJB In the following example we will develop a simple CMP 2.0 entity bean, the Customer EJB. The Customer EJB models the concept of a cruise customer or passenger, but its design and use is applicable across many commercial domains. As the chapter progresses the Customer EJB will be expanded and its complexity will increase to illustrate concepts discussed in each section. So this section serves only to introduce you to the entity bean and some basic concepts regarding its development, packaging and deployment. To simply things, we will skim over some concepts that are discussed in detail later in the chapter. Copyright (c) 2001 O’Reilly & Associates
If you are looking quality, fast, secure and reliable web hosting with PHP service at an affordable price, check php5 hosting services.