Defining Collection Classes

When you have defined attributes for your classes, the Define Collections sheet of the External Schema Wizard then enables you to define your collection classes, which you can then use to define references in the following step.

An example of the Define Collections sheet of the External Schema Wizard is shown in the following image.

The Collections table displays the potential and defined collections for the current external database schema.

The rows of the Collections table are grouped into sections, with a separate section for each member class of the collection; that is, the subclasses of the ExternalObject class. Each section contains a row for an array‑based collection, a set‑based collection, and a dictionary‑based collection.

Dictionaries are defined for each primary key and for each index with keys of the attributes that correspond to the table columns.

Each row of the table displays a check box at the left of the generated collection name. The row for a dictionary collection also contains its keys, and for an array collection, its order attributes. Rows that correspond to an existing collection are displayed in black.

Rows that do not correspond to an existing collection are displayed in gray and enable you to change the collection name by specifying the required name in an edit text box in the table. A changed collection name is then displayed in black.

To define collections

  1. To include all collection subclasses in your external database schema with the displayed generated names, click the Save button.

  2. To exclude a collection subclass from your external database schema, uncheck the check box at the left of that column in the Collections table.

    If you have not yet defined any collection subclasses, all generated collection subclasses are checked except for array collections. If you have added one or more collection subclasses, only those collection classes are checked; that is, your previous selections are retained and displayed when you next access the Define Collections sheet of the Wizard.

  3. Click the Save button, to retain your selection or de-selection of the collection class.

  4. Repeat steps 2 and 3 for each collection subclass that you want to create or an existing external database schema collection class that you now want to exclude.

  5. To change a generated collection class name or its options (that is, access type, keys, and the sort order):

    1. Select the required class in the Collections table.

    2. Make the required changes in the Define Class dialog that is then displayed. (Options that do not apply to the external database schema transformation process are disabled.) For details, see "Defining Your Own Classes", in Chapter 3 of the JADE Development Environment User’s Guide.

    3. Click the OK button in the Define Class dialog to save your changes and close the dialog.

  6. To add a collection subclass that is not automatically generated:

    1. Click the Add button to specify your new ExternalCollection subclass in the Define Class dialog that is then displayed. (Options that do not apply to the external database schema transformation process are disabled.) For details, see "Defining Your Own Classes", in Chapter 3 of the JADE Development Environment User’s Guide.

      Select the ExternalDictionary, ExternalArray, or ExternalSet class as the superclass.

    2. Click the OK button in the Define Class dialog to save your new collection class (which is then displayed in the Collections table).

  7. To delete a collection subclass, uncheck its check box and then click the Save button. Alternatively, select the class that you want to delete in the Collections table, and then click the Remove button. If the collection is used anywhere in the external database, you are prompted to confirm that you want to delete it.

  8. Click the Next > button when you have defined all of the required collection classes.

    Alternatively, click the Close button to close the wizard.

When you click the Next > button, the External Schema Wizard then enables you to define references.

If you have made any changes to your collection definitions that you have not yet saved, a warning is issued before the next sheet is displayed.