Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous section

Populating Contact and PhoneNumber

After importing an XML file containing the class definition for CSPTutorial.Contact or CSPTutorial.Contact and PhoneNumber, you can populate Caché with sample instances of the classes. Here's how:

  1. Compile the classes. You can do this in Studio by clicking Build —> Compile.

  2. Open the Terminal in the namespace in which you installed and compiled the classes. If the Terminal does not open in the correct namespace, use the ZN command to change namespaces. For example, if the terminal opens in the SAMPLES namespace and the classes are installed in USER do the following:

    Copy code to clipboard
  3. Populate Contact by invoking the Populate method. The single integer argument specifies the number of instances to create. Note that because of their parent-child relationship, you must populate Contact before you populate PhoneNumber.

    USER>Do ##class(CSPTutorial.Contact).Populate(5)
    Copy code to clipboard
  4. If you are also populating PhoneNumber, follow the same procedure:

    USER>Do ##class(CSPTutorial.PhoneNumber).Populate(15)
    Copy code to clipboard

You must populate CSPTutorial.Contact before you populate CSPTutorial.PhoneNumber. This is due to the relationship between the two classes.

To learn more about the Caché Data Population Utility, read The Caché Data Population Utility in Using Caché Objects.