Besides elements and their attributes, such a mapping always includes the notion of child elements.
When some object of the external data source, which is mapped to element1
,
aggregates in itself another object mapped to element2
,
then, according to the mapping, the element2
may be considered as a
child of element1
.
In that case, element1
will be parent of element2
.
It is always possible to find for a given element all its children that comply with a particular Element Type. This is guaranteed by any DSM Type.
However, the opposite is not always true. For some special data sources, it is not always possible to find for a given element another DSM element the child of which it is, even if such an element (the parent) does exist.
GOMElement.parent
property.
For example, if an element
has children of
SomeElementType
, the following expression must
return true
:
child = element.findChild ("SomeElementType");
child.parent.id == element.id
element
has a parent
,
then all members of the chain:
{ element->parent,
parent->parent,
parent->parent->parent,
... }
null
).
See Also:
GOMElement.parent, GOMElement.ancestors, findAncestor(), findChildren()