Normalized vs. Denormalized Representation
In the case of service interface and QAD JIT Sequencing APIs, all temp-table parameters are expressed in normalized form, in which the relationship between parent and child temp-tables is represented only as a set of common key fields (foreign keys) that occur in both tables. That is, one temp-table is not contained in or structurally subordinate to the other. Rather, all appear as siblings in the API signature.A complex QDoc element that contains another complex QDoc element (in denormalized fashion) is mapped to two separate temp-tables in the service interface and QAD JIT Sequencing APIs. In addition, all designated key fields appearing in the parent element are duplicated inside the child temp-table records with the same values as in their respective parent temp-table records. In other words, the normalized temp-table records contain foreign key values referencing their respective temp-table parent records, as with any normalized relational data structure.In order to designate those simple QDoc elements (fields) inside a particular complex QDoc element (temp-tables) that constitutes the primary key, a special primaryKeys attribute is defined in the QDoc namespace for inclusion in all QDoc XML schema files. Its definition is stored in common XML schema files. This attribute is used with all XML schema element definitions that are bound to service interface and QAD JIT Sequencing API temp-tables, so that the QDoc Request Handler can identify the parent-child and key relationships from the XML schema and properly normalize the resulting temp-tables. The following QDoc examples illustrate use of this attribute within QDocs.The XML schema definition for the primaryKeys attribute is as follows.<attribute name="primaryKeys" type="token">
<annotation>
<documentation>
Lists the primary keys of the QDoc element for the
purpose of normalizing its child elements into sibling
data structures with fully unique keys.
Used to map the unnormalized QDoc XML into a temp-table
representation for the service interface APIs.
</documentation>
</annotation>
</attribute>
The UI APIs work natively with denormalized data structures, and do not require such transformation to normalize the QDoc elements.