25.01.2015 Views

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Class Definition Classes<br />

Class<br />

%Dictionary.AbstractDefinition<br />

%Dictionary.ClassDefinition<br />

%Dictionary.ForeignKeyDefinition<br />

%Dictionary.IndexDefinition<br />

%Dictionary.MethodDefinition<br />

%Dictionary.ParameterDefinition<br />

%Dictionary.PropertyDefinition<br />

%Dictionary.QueryDefinition<br />

%Dictionary.TriggerDefinition<br />

Description<br />

Abstract base class for all class definition classes.<br />

Represents a class definition. Contains class keywords<br />

as well as collections containing class member<br />

definitions.<br />

Represents a foreign key definition within a class.<br />

Represents an index definition within a class.<br />

Represents a method definition within a class.<br />

Represents a parameter definition within a class.<br />

Represents a property definition within a class.<br />

Represents a query definition within a class.<br />

Represents an SQL trigger definition within a class.<br />

23.1 Browsing Class Definitions<br />

You can use the class definition classes to browse through the class definitions within the<br />

<strong>Caché</strong> dictionary using the same techniques you would use in a database application: you<br />

can use the %ResultSet object to iterate over sets of classes and you can instantiate persistent<br />

objects that represent specific class definitions.<br />

For example, from within a <strong>Caché</strong> process you can get a list of all classes defined within the<br />

dictionary for the current namespace by using the %Dictionary.ClassDefinition:Summary<br />

query:<br />

Set result = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:Summary")<br />

Do result.Execute()<br />

While (result.Next()) {<br />

Write result.Data("Name"),!<br />

}<br />

You can just as easily invoke this query from an ActiveX or Java client using the client<br />

ResultSet object.<br />

This %Dictionary.ClassDefinition:ClassInfo query will return all of the classes visible<br />

from the current namespace (including classes in the system library). You can filter out<br />

unwanted classes using the various columns returned by the<br />

%Dictionary.ClassDefinition:Summary query.<br />

194 <strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!