O'Reilly logo

J2EE™ Applications and BEA™ WebLogic Server™ by Sandra L. Emerson, Rob Woollen, Michael Girdley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CMP

Entity beans that use CMP do not include JDBC code: The EJB container generates code that provides automatic persistence. The EJB container calls the ejbCreate methods before the bean has been inserted into a database. The ejbCreate method generally uses its parameters to initialize the entity bean's fields. The ejbCreate method must set primary key fields.

ejbCreate

After the ejbCreate method returns, the EJB container extracts the primary key fields from the bean instance and performs a database insert. The ejbCreate method always returns null in any CMP entity bean. While this looks strange at first, it is required to enable a BMP bean to extend a CMP bean. We'll discuss this requirement later in this chapter.

ejbRemove

A CMP entity bean's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required