regenerateRelationalView

regenerateRelationalView(viewName:        String;
                         excludedClasses: ClassColl;
                         rootClass:       Class);

The regenerateRelationalView method of the Schema class builds the relational view specified in the viewName parameter. Call this method in your application logic to dynamically build a relational view at run time after changes to the schema, instead of using the Relational Views Wizard.

Use the excludedClasses parameter to specify the collection of classes that you want excluded from the relational view and the rootClass parameter to specify the root class of the view. If the view does not exist, a new view is created. If a view of the specified name already exists, it is deleted and replaced with the new view.

The following example shows the use of the regenerateRelationalView method.

makeNewView();
vars
    clsColl : ClassColl;
begin
    create clsColl transient;
    Object.allSubclassesUpToSchema(rootSchema, clsColl);
    currentSchema.regenerateRelationalView("MyView", clsColl, Company);
    delete clsColl;
end;

The method in this example creates or regenerates a relational view identical to that generated by using the Relational View Wizard (assuming there is a Company class) and accepting all default values in the wizard steps summarized in the following table, unless specified in the following list.

Step Comment
Naming Your Relational View MyView name is specified
Specifying Relational View Options Include Super Schema Classes check box is checked
Selecting Classes and User-Defined Tables for Your Relational View  
Setting the Root Class Company class is selected as the root class
Setting the Default Included Object Features  
Setting the Visibility of Protected Features Include All option is selected
Setting the Visibility of Derived Tables  
Refining the Visibility of Class Features  
Building Your Relational View The Finish button is clicked, to generate the relational view

For details about creating a relational view and the steps provided by the Relational View Wizard, see "Adding a Relational View", in Chapter 9 of the JADE Development Environment User’s Guide.