Home
Creating a Java field using the Create Java field wizard
For our example, we create Java fields by doing the following steps:
Select the Transaction class and click the Add Java Field icon from the action box.
In the Create Java Field dialog, enter the following data (Figure | 21).
Name: timeStamp
Type: java.sql.Timestamp. To select this type, click Browse, type in the Pick a class or interface field, and click OK. Required import statements are added to the source code automatically.
Dimensions: 0 (default)-Changing the value of this field is for creating an array of the selected type with the selected dimension.
Contained by Java Collection: clear (default)
Note: Select this check box If the required attribute has a multiplicity higher than 1. If selected, the wizard allows you to select the required Java collection class. If you select any kind of Map class, you can select the type of the key in the Java collection key type field. Finally, you can create parameterized types by selecting the use generic collection check box. More information about generic types can be found here:
http://java.sun.com/developer/technicalArticles/J2SE/generics/
Initial value: null
Visibility: private (default)
Modifiers: clear all (default)
Click Finish to create the Java field.
Figure 8-21 Create Java Field dialog
Note: There are two reasons why you might not see the attributes in the class diagram:
Class diagram attribute compartment is collapsed-Select the interface or class and click the little blue arrow in the compartment in the middle. That expands the attribute compartment.
Class diagram attribute compartment is filtered out-Right-click the interface or class and select Filters Æ Show/Hide Compartment Æ Attribute Compartment.
ibm.com/redbooks