Relationships

If you want to create a hierarchical data structure, e.g. Invoice with InvoiceDetail, you need to create relationships between entities. After specifying a relationship, you need to specify keys for it.

Attributes

RelatedEntity Points to the entity to which an entity has a relation.
IsSelfJoin Deprecated. Do not use.
IsOr

When the relationship has multiple keys they are normally rendered as "EntityA.Key1 = EntityB.refEntityAKey1 AND EntityA.Key2 = EntityB.refEntityAKey2".

When set to True, OR will be used between keys instead of AND.

IsParentChild

Indicates that the base entity is a parent and the entity we are relating to is a child. By setting it to True, the following attributes are activated:

  • Cascading Delete: When the data structure contains both parent and child entities. By deleting the parent record the child is also deleted.
  • Nested XML: Tags will get nested, which will result in faster XSL Transformations and the XML document will be easier to read.

Warning

Set IsParentChild only where child records are not linked to more than 1 parent. Otherwise you will get the "A child row has multiple parents" error after reading data to a data structure which contains this relation.

Example XML nesting if IsParentChild = False

<Parent/>
<Parent/>
<Child/>
<Child/>

Example XML nesting if IsParentChild = True

<Parent>
  <Child/>
  <Child/>
</Parent>
<Parent>
 <Child/>
 <Child/>
</Parent>

Child Elements