Using Caché Objects - InterSystems Documentation
Using Caché Objects - InterSystems Documentation
Using Caché Objects - InterSystems Documentation
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Operation<br />
11.2 Operation<br />
This section describes the basic features and functionality of <strong>Caché</strong> data types.<br />
11.2.1 <strong>Using</strong> Data Types in Classes<br />
The principal function of data type classes is for specifying the types of properties within a<br />
class. The basic definition format is:<br />
Property City As %String;<br />
Because data types are part of the %Library package, you can simply call them without<br />
explicitly mentioning the package name.<br />
11.2.1.1 Validation Functionality<br />
Any property using a system data type (or a data type derived from a system data type) supports<br />
data validation through a generated method associated with the property. The validation<br />
method has a name of the form PropertyNameIsValidDT; for instance, an Age property of<br />
type %Integer has an associated AgeIsValidDT method. The method checks the validity of<br />
a value specified for the property.<br />
11.2.2 Parameters<br />
Data type classes support various parameters. These perform various actions and vary from<br />
data type to data type. These parameters include:<br />
• COLLATION — Specifies the manner in which property values are transformed for<br />
indexing.<br />
The allowable values for collation are discussed in the SQL Introduction.<br />
• DISPLAYLIST — Used in conjunction with the VALUELIST parameter for enumerated<br />
(multiple-choice) properties. DISPLAYLIST, if not null, represents the display values<br />
for the property corresponding with the logical values listed in VALUELIST. The display<br />
values are returned by the LogicalToDisplay method.<br />
• FORMAT — Specifies the format for the data type's display value. The value of FORMAT<br />
corresponds to the formatting option of the $FNUMBER function, which performs the<br />
formatting.<br />
<strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong> 91