The Enterprise JavaBeans™ (EJB) transformation generates EJB and Java™ code from UML model elements.
UML object | What is transformed |
---|---|
Model | All packages, classes, and interfaces that the model contains |
Package | The package and all classes and interfaces that the package contains |
Class | The class and all attributes, operations, classes, and interfaces that the class contains |
Interface | The interface and all attributes, operations, classes, and interfaces that the interface contains |
The transformation can generate output to a single EJB project. You can create the EJB project with or without a client project. The transformation generates code in the first detected source folder of the EJB project and in the first detected source folder of the client project, if one exists.
You can create a mapping model to specify alternate names for the elements that the transformation generates without modifying the source model. You might want to specify alternate names if you want to include Java-specific details (such as naming restrictions) in platform-independent models, or if the logical organization of the source model is not appropriate as target packaging.
A mapping model is a separate model that has an artifact for each transformable element. Each artifact refers to and has the same name as the original transformable element. You can specify an alternate name by changing the filename property of the artifact.
You can specify a qualified name such as com.ibm.NewName.com or an unqualified name such as NewName. Specifying alternate names for packages, affects all classifiers in that package unless the classifier specifies a fully qualified name. You can also specify alternate locations within the same project for elements that the transformation generates.
If you select the Generate Source to Target Relationships option, the UML to EJB transformation creates derived relationships from generated Java elements to their UML source model element. The transformation adds tags to the Javadoc of the generated java classes and interfaces, which contain information that enables tools to trace the generated files to the UML source element. For generated EJBs, all the Java files that the transformation generates have source-to-target Javadoc tags that point to the single UML source class. After the transformation generates source-to-target relationships for EJBs, you can only remove them manually. You must edit the individual Java files for each EJB and delete the source-to-target relationship tag from the file’s Javadoc.
Related tasks
Generating EJBs and Java classes from a model
Applying the EJB transformation profile
Applying the EJB transformation
Related reference
Installed transformations