Reapply scenarios

When a target Java 2 Platform, Enterprise Edition (J2EE) project includes at least one bean with the same name and namespace as a UML class in the transformation, a reapply scenario can occur. A reapply scenario refers to when the type of the existing enterprise bean matches the type of the enterprise bean to be generated for the corresponding class in the UML model.

When the type of the enterprise bean to be generated is incompatible with the type of the existing enterprise bean, a collision scenario occurs. In a collision scenario, the UML to EJB transformation does not update the existing bean and does not generate a new enterprise bean.

The following table lists the expected response of the transformation to possible reapply scenarios for CMP 2.x entity beans:

Enterprise bean to be generated

Existing enterprise bean

Expected scenario

Transformation response

CMP 2.x

CMP 2.x

Reapply

Update CMP fields and methods

CMP 2.x

CMP 1.1

Reapply

Update CMP fields and methods as though it were a regular CMP 1.1-to-CMP 1.1 reapply scenario

CMP 2.x

BMP

Reapply

Update BMP fields and methods as though it were a regular BMP-to-BMP reapply scenario

CMP 2.x

Session (stateful or stateless)

Collision

Leave the session bean untouched

CMP 2.x

Message-driven

Collision

Leave the message-driven bean untouched

 

The following table lists the expected response of the transformation to possible reapply scenarios for CMP 1.1 entity beans:

Enterprise bean to be generated

Existing enterprise bean

Expected scenario

Transformation response

CMP 1.1

CMP 2.x

Reapply

Update CMP fields and methods as though it were a regular CMP 2.x-to-CMP 2.x reapply scenario

CMP 1.1

CMP 1.1

Reapply

Update CMP fields and methods

CMP 1.1

BMP

Reapply

Update BMP fields, methods, and associations as though it were a regular BMP-to-BMP reapply scenario

CMP 1.1

Session (stateful or stateless)

Collision

Leave the session bean untouched

CMP 1.1

Message-driven

Collision

Leave the message-driven bean untouched

 

The following table lists the expected response of the transformation to possible reapply scenarios for BMP entity beans:

Enterprise bean to be generated

Existing enterprise bean

Expected scenario

Transformation response

BMP

CMP 2.x

Reapply

Update CMP fields and methods as though it were a regular CMP 2.x-to-CMP 2.x reapply scenario

BMP

CMP 1.1

Reapply

Update CMP fields and methods as though it were a regular CMP 1.1-to-CMP 1.1 reapply scenario

BMP

BMP

Reapply

Update BMP fields and methods

BMP

Session (stateful or stateless)

Collision

Leave the session bean untouched

BMP

Message-driven

Collision

Leave the message-driven bean untouched

 

The following table lists the expected response of the transformation to possible reapply scenarios for session beans:

Enterprise bean to be generated

Existing enterprise bean

Expected scenario

Transformation response

Session (stateful or stateless)

CMP 2.x

Collision

Leave the CMP 2.x bean untouched

Session (stateful or stateless)

CMP 1.1

Collision

Leave the  CMP 1.1 bean untouched

Session (stateful or stateless)

BMP

Collision

Leave the BMP bean untouched

Session (stateful)

Session

(stateful only)

Reapply

Update the fields and methods of the session bean

Session (stateful)

Session

(stateless only)

Collision

Leave the stateless session bean untouched

Session (stateless)

Session

(stateful only)

Collision

Leave the stateful session bean untouched

Session (stateless)

Session

(stateless only)

Reapply

Update the fields and methods of the session bean

Session (stateful or stateless)

Message-driven

Collision

Leave the message-driven bean untouched

 

The following table lists the expected response of the transformation to possible reapply scenarios for message-driven beans:

Enterprise bean to be generated

Existing enterprise bean

Expected scenario

Transformation response

Message-driven

CMP 2.x

Collision

Leave the message-driven bean untouched

Message-driven

CMP 1.1

Collision

Leave the message-driven bean untouched

Message-driven

BMP

Collision

Leave the message-driven bean untouched

Message-driven

Session (stateful or stateless)

Collision

Leave the message-driven bean untouched

Message-driven

Message-driven

Reapply

Update the fields and methods of the message-driven bean

 

The following table lists the expected response of the transformation to possible reapply scenarios for unmarked UML classes:

Stereotype on UML class

Existing enterprise bean

Expected scenario

Transformation response

Unmarked

CMP 2.x

Reapply

Update the fields and methods of the CMP 2.x entity bean in its existing remote interface

Unmarked

CMP 1.1

Reapply

Update the fields and methods of the CMP 1.1 entity bean in its existing remote interface

Unmarked

BMP

Reapply

Update the fields and methods of the BMP entity bean in its existing remote interface

Unmarked

Session (stateful or stateless)

Reapply

Update the fields and methods of the Session in its existing remote interface

Unmarked

Message-driven

Reapply

Generate a typical Java class

 

In the reapply scenarios for unmarked UML classes, the code updates to the remote interface of the existing enterprise bean cause build errors in the EJB project. These build errors occur because the updated code in the remote interface does not conform to EJB specifications for remote interfaces. If you intend to overwrite the entire enterprise bean, you must remove the existing enterprise bean before you run the EJB transformation.

Detailed explanation of the transformation's response

This section discusses the transformation's response to a reapplication scenario in more detail and provides more information about what to expect from the transformation after a reapplication.

CMP 2.x entity beans

If a reapplication scenario occurs for a CMP 2.x entity bean, the following modifications might occur:

 

The following modifications should not occur:

CMP 1.1 entity beans

If a reapplication scenario occurs for a CMP 1.1 entity bean, the following modifications might occur:

 

The following modifications should not occur:

 

BMP entity beans

If a reapplication scenario occurs for a BMP entity bean, the following modifications might occur:

 

The following modifications should not occur:

Stateless and stateful session beans

If a reapplication scenario occurs for a session bean, the following modifications might occur:

 

The following modifications should not occur:

Message driven beans

If a reapplication scenario occurs for a message-driven bean, the following modifications might occur:

 

The following modifications should not occur:

 

Terms of use | Feedback
(C) Copyright IBM Corporation 2004.
All Rights Reserved.