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).

Next section


Specifies additional names for this property for use via object access.


To specify additional names for the property, use the following syntax:

Property name As classname [ Aliases=othernames ]; 

Where othernames is a comma-separated list of valid property names, enclosed in curly braces.


If you specify the Aliases keyword, the compiler creates the given alias or aliases, which point to the same underlying data that the original property points to. For example, suppose we redefine the Name property of Sample.Person as follows:

Property Name As %String(POPSPEC = "Name()") [ Aliases = {Alternate}, Required ];
Copy code to clipboard

Then your code can then work with either the Name property or the equivalent Alternate property, as shown in the following Terminal session:

SAMPLES>set p=##class(Sample.Person).%OpenId(1)
SAMPLES>w p.Name
Fripp,Charles Z.
SAMPLES>w p.Alternate
Fripp,Charles Z.
SAMPLES>set p.Alternate="Anderson,Neville J."
SAMPLES>w p.Name
Anderson,Neville J.
Copy code to clipboard

Any property methods associated with the original property are also defined for each alias property, so in this example AlternateIsValid() is callable and returns the same result as NameIsValid() method does. Also if you override a property method (for example, writing a custom NameGet() method), then that override automatically applies to the alias property or properties.


This keyword has no effect on the SQL projection of the property.


By default, this keyword is null and a property has no aliases.


Property PropA As %String [ Aliases={OtherName,OtherName2} ]; 
Copy code to clipboard

See Also