Chapter 14 Working with Java


Understanding EJB code generation

The code generation mechanism is only described for Entity beans CMP in this section since the code generated is handled and stored in the Container. With Entity beans BMP, session beans and message-driven beans, the code generated is highly dependent on the bean developer's input, it would thus not be possible to introduce each possible configuration here.

The process of code generation is explained below in order for you to understand the mechanism:

The generation of EJB class and interface into code is performed like if they were Java classes, except that they are dependent on an EJB and thus contain more information to be processed during generation.

The code generation process performs the following tasks:

  1. It creates the following inheritance links:

  2. Here is an example from the Preview page of the remote interface:
  3. It creates the following realization links:

  4. Here is an example from the Preview page of the Bean class:
  5. It transforms attributes flagged as persistent into getter and setter methods (cmp-fields and cmr-fields are generated as getters and setters).

    cmp-fields are attributes flagged as Persistent in the property sheet. cmr-fields are attributes that are migrated from associations.

    Here is an example from the Preview page of the Bean class:

 


Copyright (C) 2005. Sybase Inc. All rights reserved.