Mapped join
A Mapped join enables access to data for a data field of an entity within the search, which can be found in a separate table on the database side.
In contrast to the Entity join, the Mapped join supports Restrictions for the implicit join for the (1:1) or (1:n) relation behind the data field path selected as the Join property when mapping field values.
The assignment can be additionally restricted using both the generic On condition and the generic Treat parameter. Both parameters allow the optional definition of Restrictions, which are combined in an AND junction with the implicit On condition. These restriction options are a typical reason for using a Mapped join. Unrestricted access to property values would also be possible directly via a Property projection using the path selected as the Join property.
Configuration
Parameter |
Data type |
Desscription |
|
Specific parameters |
|||
Join Property |
Data field path |
The Combobox Join property supports the selection of a valid data field path in the context of the search either via dropdown or direct entry, which must be completed by clicking on the + symbol or pressing the 'Enter' key.
|
|
Treat |
Search treat |
The Treat parameter provides an optional configuration for 'Search treat' (Treat):
The associated user interface (right) with the As and On condition parameters only appears after the 'Search treat' has been added in the context menu of the value configuration (left). |
|
└ As |
Entity type |
In the Combobox for As, an entity type can be selected that overrides the entity type derived from the definition for the Join property for the Join alias for the context of the definition of the On condition parameter. |
|
└ On condition |
Restriction |
|
For the definition of the On condition, the entity type selected under As applies to the Join alias. In the example on the left, the overarching 'Entity' (Entity) type was selected for As. A Simple property restriction was then selected under On condition. The Combobox element for the Projection then only shows paths for fields for the Join alias a that are supported by the selected 'Entity' (parent) class. |
Generic parameters |
|||
Join alias, Join type, Optional, On condition see Entity join |
Examples
Typical use case: (1:n) relation
The entity type 'E-mail' (Mail, see E-mails) uses a list field involved to list different 'e-mail participants' ('From', 'To', 'CC', 'BCC').
A Tuple search for E-mails should only output the visible recipient addresses (type 'To' or 'CC') in a 'recipient' column.
Configuration:
The screenshot on the right shows the configuration for a Mapped join, which enables the selective listing of 'e-mail participants':
|
|
The Mapped join with the alias recipient provides the individual values for recipients, which can be prepared as list values for the output column recipients as shown on the right using Collection projection:
|
|
►NOTE◄ If an additional output column is only to specify the sender ( e-mail participant type 'From'/SEND_FROM), an additional Mapped join with an independent Join alias (e.g. sender) for the same Join property (involved) must be set up for this purpose. As each e-mail should only have precisely one sender, this can be defined directly as an output column via a Property projection (sender.involved).
Special use case: (1:1) Relation with constraint
The accounts for Users refer to an entity of the type 'address' via the 'address' (address) property, so that the address properties from the database table for Addresses (base_address) must be included if these are addressed in Projections in the context of a search for Users. The selection of a data field path such as address.name1 implies the join from the user table to the address table.
In the following example, a Mapped join with a secondary condition is used instead of the implicit join so that address data is not always 'added' but only when a secondary condition is fulfilled.
A CSV search for Users should always output the address field 'Name' (name1.address) in addition to the 'User name' (username), but only output further address data (here: 'City'/city and 'Country'/countryCode) if the 'Account number' (address.accNumber) address property begins with the number 1.
Configuration:
The Mapped join shown on the right serves as the basis for conditional access to a user's address:
|
|
The screenshot on the right shows the Projections for the output columns of the CSV search
|
|