Adding an Attribute Property

Use the Add Attribute command from the Properties menu to add a static attribute property to the class currently selected in the Class Browser. (For details about adding a dynamic attribute, see "Defining an Attribute Property" under "Dynamic Clusters and Properties".)

To add an attribute property

  1. In the Class Browser window, select the class to which the attribute is to be added.

  2. Select the Add Attribute command from the Properties menu.

    The Define Attribute dialog, shown in the following example, is then displayed.

    The Define Attribute dialog enables you to define your new attribute property for the selected class.

  1. In the Name text box, specify the name of the attribute property that you want to define.

    The attribute name must be unique to the class to which it is being added and it cannot exist in any of its superclasses or subclasses.

  2. In the Type combo box, perform one of the following actions.

    • Select the required type in the Type list.

    • Specify the first character or the first few characters of the type in the text box and then select the required type from the Type list. The selected type is then displayed in the Type combo box.

    The type can be any primitive type or any primitive array class defined in the schema.

  3. In the Access group box, select the appropriate type of access if you do not want access to the property to be protected. The Protected option button is selected by default, so that the property can be accessed only by methods defined in the selected class and its subclasses. (A protected property is displayed in the Properties List of the Class Browser with a padlock icon to the left of the property.)

    Select the Public option button if you want the property to be read and modified by any other method in the schema. (A property that has public access is displayed in the Properties List of the Class Browser with the public icon to the left of the property.)

    Select the Read Only option button if you want the property to be read by other methods in the schema but not updated. (A read-only property is displayed in the Properties List of the Class Browser with the read-only icon to the left of the property.)

    If the property is of type StringArray, IntegerArray, or one of the other primitive array types, the access mode setting applies to the array object rather than to the elements within the array; that is, a setting of read‑only does not prevent array elements being added, deleted, or updated.

  4. If you have specified a Decimal, Binary, or String primitive type for the property, specify the length of the property in the Length text box of the Primitive group box. Alternatively, check the Maximum Length check box if you want the length of the property to be an unbounded string of the maximum length. (The Length text box is disabled when you check the Maximum Length check box.)

    The default and maximum lengths are listed in the following table.

    Type Default Length Maximum Bounded Length Maximum Unbounded Length
    Decimal 12 23 Not applicable
    String 30 100,000-1 Max_UnboundedLength in the SystemLimits global constants category
    Binary 30 100,000-1 Max_UnboundedLength in the SystemLimits global constants category
  5. If you have specified a Decimal primitive type for the property, specify the number of decimal places for the property in the Scale Factor text box of the Primitive group box.

  6. Check the Virtual check box if you want the value of the property to be derived at run time and never stored in the database. (A virtual attribute cannot be a collection.)

    A virtual attribute property requires a defined mapping method that is activated when the value of the attribute is set or retrieved.

  7. Check the Subschema Hidden check box if you want to specify that the attribute property is available only in the local schema; that is, it is not available for use in any subschemas.

    In a subschema copy class, you cannot define a mapping method for a subschemaHidden property that is defined in a superschema. For details, see "subschemaHidden Option" under "Controlling the Use of Elements in Other Schemas", in Chapter 1.

  8. Click the Enter Text button if you want to specify or maintain descriptive text for the attribute property as part of the definition or maintenance of the attribute. For details, see "Specifying Text for a Schema Element", in Chapter 3.

    You can also specify descriptive text for the attribute at any time, by selecting the Text command from the Properties menu. For details, see "Using the Free-Standing Editor Window to Define Text", in Chapter 3.

  9. Click the OK button. Alternatively, click the Cancel button to abandon your selections or the Next button to define another attribute property.

The specified attribute property is then displayed in the Properties List of the Class Browser and the values that you defined for the property displayed in the editor pane.

If a property template has been defined for all new properties in your JADE development database or for your own JADE properties, the property template is displayed below the attribute property details in the editor pane when you click the OK button on the Define Attribute dialog. For details, see "Maintaining Text Templates", in Chapter 2.