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.
<strong>Objects</strong> and SQL<br />
Note:<br />
There is no Siblings column in the parent table.<br />
For the column(s) containing the array members, the number and contents of the column(s)<br />
depend on the kind of array:<br />
• The projection of an array of data type properties is a single column of data.<br />
• The projection of an array of reference properties is a single column of object references.<br />
• The projection of an array of embedded objects is as multiple columns in the child table.<br />
The structure of these columns is as is described in the section Embedded Object Properties.<br />
Together, the ID of each instance and the identifier of each array member comprise a unique<br />
index for the child table. Also, if a parent instance has no array associated with it, it has no<br />
associated entries in the child table.<br />
13.2.2.7 List Properties<br />
A list property is projected as a string in $LIST format, which means that all the elements<br />
within the collection are concatenated and projected as a single string. For example, suppose<br />
the Person class has a Cars list property, where Cars is a list of strings that are license plate<br />
numbers. This property appears as a single column called Cars and might appear in the Person<br />
projection as follows (looking at a partial view of the table):<br />
Sample Projection of a List Property<br />
ID<br />
1<br />
2<br />
3<br />
Cars<br />
324WLI,395BCE<br />
253COM<br />
512SEL,710LRR,526SJL<br />
The list field contains a string constructed by concatenating the individual elements of the<br />
list:<br />
New cars<br />
&sql(SELECT Cars INTO :cars<br />
FROM Person<br />
WHERE ID = :id)<br />
Given an id value of 1, cars has a value equivalent to a list based on the “324WLI” and “<br />
395BCE” strings.<br />
120 <strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong>