Friday, December 18, 2009

Chapter 5. EJB CMP



[ Team LiB ]







Chapter 5. EJB CMP



Blessed are the sleepy ones: for they shall soon doze off.

桭riedrich Nietzsche,

Also Sprach Zarathustra




Container-managed persistence (CMP) is a
persistence model in which the EJB container worries about
persistence issues while you worry about business logic management.
Under the CMP model, you leave most of the EJB persistence
methods�A NAME="javadtabp-CHP-5-ITERM-1855"> ejbFindXXX( ),
ejbLoad( ), ejbStore( ), and
ejbRemove( )梕mpty. Based on a mapping you
define in the application's deployment descriptor,
the container implements those methods and crafts the SQL to map your
beans to the database.



EJB 2.0 CMP is a drastic departure from梐nd improvement
upon桬JB 1.0 CMP. Nevertheless, the majority of systems in
production these days are still in EJB 1.x environments. This chapter
takes a look at both CMP models and describes how to use them in a
production environment. As with any automated persistence mechanism,
there is not a lot that EJB CMP requires you as the developer to do.
The focus for this chapter is specifically on the aspects of the EJB
1.0 and EJB 2.0 CMP models that most impact persistence issues. Once
you understand these concepts, you will find that you are left with
almost no persistence coding to do under EJB CMP梐ll your work
lies in setting up the database and writing deployment descriptors.



This chapter assumes you have a basic understanding of Enterprise
JavaBeans. It specifically assumes that you know the difference
between entity and session beans and are familiar with home
interfaces, remote interfaces, and implementation objects. If you do
not have this background, you should review the Enterprise JavaBeans
section of Chapter 9. I also strongly recommend
the book

Enterprise JavaBeans
(O'Reilly) by Richard Monson-Haefel if you intend to
do serious programming in an EJB environment.







    [ Team LiB ]



    No comments: