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 |
---|---|
|
MyView name is specified |
|
Include Super Schema Classes check box is checked |
|
|
|
Company class is selected as the root class |
|
|
|
Include All option is selected |
|
|
|
|
|
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 "