join element

Last update: 2023-08-01

Content model

join:==EMPTY

Attributes

  • @dstFilterExpr (string)
  • @xpath-dst (string)
  • @xpath-src (string)

Parents

<element>

Children

None

Description

Lets you define the fields that create a join between SQL tables.

Use and context of use

A <join> element can only be used if the parent <element> element is of ‘link’ type. This means that the parent element must have the “@type=link” attribute declared.

It is not necessary to specify the name and namespace of the remote table in the <join> element. They need to be specified in the parent <element>.

By convention, links are defined at the end of the schema.

If the <join> element isn’t specified when the link type element is defined, the link will automatically be placed on the primary keys of both tables.

Attribute description

  • dstFilterExpr (string): this attribute lets you restrict the number of eligible values in the remote table.
  • xpath-dst (string): this attribute receives an Xpath (@name attribute of the remote table).
  • xpath-src (string): this attribute receives an Xpath (@name attribute in the current schema).

Examples

Link between the ‘email’ field of the current table and the “@compagny-id” field of the remote table:

<join xpath-dst="@compagny-id" xpath-src="@email"/>

Filtered link towards the “cus:Country” table based on the content of the “@country” field which must contain the ‘EN’ value:

<element name="StockEN" type="link" label="MyLink" target="cus:Stock">
   <join xpath-dst="@country" xpath-src="@code" dstFilterExpr="@country = 'EN'"/>
 </element>

On this page