docs.intersystems.com
MultiValue Quick Start Tutorial
Class Definition
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Search:    

PROTOCLASS generates a Caché class for PERSON. By default, the name of this class is MVFILE.PERSON where MVFILE is a package name. You can view the class definition in Studio. See the note below for instructions on using Studio.
The class definition includes several pieces, including parameter, property, and index declarations. The property definitions correspond to the attributes defined in the original multivalue file. Here's how the look:
Property Age As %String(COLLATION = "MVR", MVATTRIBUTE = 1, MVAUTO = "P", MVNAME = "AGE", 
                                                 MVPROJECTED = 0, MVTYPE = "D");

Property Hair As %String(COLLATION = "SPACE", MVATTRIBUTE = 2, MVAUTO = "P", MVNAME = "HAIR", 
                                                 MVPROJECTED = 0, MVTYPE = "D");
Property ItemId As %String;

Property Name As %String(COLLATION = "SPACE", MVATTRIBUTE = 3, MVAUTO = "P", MVNAME = "NAME", 
                                                 MVPROJECTED = 0, MVTYPE = "D");

Property Phone As list Of %String(COLLATION = "SPACE", MVATTRIBUTE = 4, MVAUTO = "P",
                               MVNAME = "PHONE", MVPROJECTED = 0, MVTYPE = "D");
   
The class definition declares a property for each attribute of the multivalue file. Each of the properties has the Caché data type %String except for PHONE, which is a collection of %String instances. The Caché PHONE property represents the multivalue PHONE attribute in the original multivalue file.
Note:
Read Opening a File in Studio for instructions on opening Studio, connecting to a namespace, and opening a file.
Read Using Studio for a comprehensive guide to using Studio.
Read Using Caché Objects for a comprehensive guide to using Caché objects. This includes discussions of property, parameter, and index declarations along with the other parts of a Caché class definition.


Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA