Summary
The EJB 2.0 Entity Model
The 2.0 version of the specification for Enterprise JavaBeans introduces important improvements to the
bean-managed and container-managed models for entity persistence. Programmers writing entities with
bean-managed persistence (BMP) may benefit from the addition of local interfaces and home-interface
methods to the specification. Programmers writing entities with container-managed persistence (CMP)
can choose to take advantage of an entirely new CMP model.
This new EJB 2.0 persistence model is not just a fine-tuning of features that were available in the EJB 1.1
specification. Instead, EJB 2.0 persistence is a revolutionary addition of a standards-based object-
relational mapping framework to Enterprise JavaBeans technology. This chapter will concentrate on the
new CMP persistence model, although it will also give an example of the new features available to
entities using BMP persistence.
Some of the important points we will be covering in this chapter include:
-
The differences between EJB 1.1 CMP and EJB 2.0 CMP
-
Abstract methods and their role in EJB 2.0 CMP
-
Local interfaces, relationships, and the client view
-
The representation of relationships between entities
-
The EJB 2.0 query language
-
Home interface methods
As the changes the entity beans are so significant, this chapter will primarily provide an overview of
the EJB 2.0 persistence model, and then look at BMP entities under the new specification. In the
next chapter we will drill down in the 2.0 CMP model in greater depth.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.