Protecting changes to code

To protect the changes that you make to the code that the UML-to-EJB 3.0 transformation generates, you must alter the @generated annotation or add code only to specific locations in the generated code.

About this task

To protect the changes that you make to the generated code, complete one of the following steps:
  • Remove the @generated annotation
    Note: If you remove this annotation, the changes that you make to the corresponding element in the model are not propagated to the code the next time that you run the transformation.
  • Alter the @generated annotation, as in this example: @wasgenerated. Inserting characters can help you to identify the generated code that the transformation does not overwrite when you rerun the transformation.
  • Add code only between the following comments in the generated code:
    // begin-user-code
    // end-user-code

To protect the information about other annotations in the code, you can include the annotation details in the corresponding stereotype in the source model. Completing this step also ensures that annotation details are not removed when you reconcile changes during the iterative development process.


Feedback