Message-Driven Beans

   

Container-Managed Persistence Changes

EJB 1.1 required container providers to support container-managed persistence (CMP), but it didn't require support for relationships between entities and it left the implementation details for finder methods totally up to the vendors . This led to limited capabilities in some cases and nonportable solutions in others. Some of the significant changes brought by EJB 2.0 relate to how CMP must be supported.

The first difference you'll notice with EJB 2.0 is in how you code your entity bean classes. The bean classes you write for a CMP entity bean are now abstract classes that define their fields through a series of abstract get and set method declarations. Instead of including any actual field declarations, your classes identify their fields using only their method declarations. These declarations form part of what is known as the abstract persistence schema for a CMP bean. It's the responsibility of the container to generate a concrete bean class based on the fields declared by your get and set methods and the relationships you define in the deployment descriptor. As part of this, the container now manages relationships between entity beans as a standard capability.

For more information on EJB 2.0 CMP, see Chapter 7, "Container-Managed Persistence," p. 185 .



Special Edition Using Enterprise JavaBeans 2.0
Special Edition Using Enterprise JavaBeans 2.0
ISBN: 0789725673
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net