13.2. CMP in EJB 1.1

Although EJB 2.0 defines a new persistence management scheme, a compliant product must continue to support the EJB 1.1 scheme. Although it is not widely used, an understanding of this scheme is helpful in seeing why the EJB 2.0 scheme has the form that it does.

EJB 1.1 defines a CMP scheme based on persistent public instance variables. It assumes that all the EJB’s properties are represented by values of its instance variables. Of course the implementation class can include both persistent and nonpersistent instance variables. Those that are intended to be persistent must be public (yes, public) and serializable [EJB1.1 9.4.1]. The necessity for these variables to be public is to allow them to be read and written by the ...

Get Applied Enterprise JavaBeans™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.