--- title: "Chained projection" slug: "core-chained-projection" updated: 2026-05-19T07:38:55Z published: 2026-05-19T07:38:55Z canonical: "docs.lobstersoftware.com/core-chained-projection" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Chained projection > [!NOTE] > Projection – Abstract > > **Purpose:** Enables the chaining of [Projections](/v1/docs/en/core-i-search-projection) and [Joins](/v1/docs/en/core-abstract-join) to provide a specific return value. > > > [!TIP] > > Tooltip > > > > - **Usage**: The [Chained projection](/v1/docs/en/core-chained-projection) allows you to string together [Projections](/v1/docs/en/core-i-search-projection) and [Joins](/v1/docs/en/core-abstract-join) to provide a specific return value that can be used in an output column or a constraint, for example. > > - **Parameter**: > > - The **Name** optionally defines the title of an output column (if relevant). By default, the name or join alias applicable to the last element of the chain is used. > > - [Projections](/v1/docs/en/core-i-search-projection) and [Joins](/v1/docs/en/core-abstract-join) can be strung together within the chain, whereby the return value of the preliminary stage is used as the *reference object* for configurations. > > - **Note**: A [Collection projection](/v1/docs/en/core-collection-projection) cannot be used within the chain, but a [Chained projection](/v1/docs/en/core-chained-projection) can provide values for a [Collection projection](/v1/docs/en/core-collection-projection). ![images/download/attachments/162409422/image-2023-12-12_17-48-17-version-1-modificationdate-1702399697657-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-12-12_17-48-17-version-1-modificationdate-1702399697657-api-v2.png) The [Chained projection](/v1/docs/en/core-chained-projection) enables the chaining of [Projections](/v1/docs/en/core-i-search-projection) and [Joins](/v1/docs/en/core-abstract-join) in order to provide a specific return value. Similar to the chaining of value resolvers (see [Chained resolver](/v1/docs/en/core-chained-resolver)), the chained elements pass on the respective return value to the subsequent level as a reference object (e.g. for [Projections](/v1/docs/en/core-i-search-projection) defined there). - Within the chain, all [Projections](/v1/docs/en/core-i-search-projection) can be used, except for the [Collection projection](/v1/docs/en/core-collection-projection) and the [Chained projection](/v1/docs/en/core-chained-projection) itself. - However, the [Chained projection](/v1/docs/en/core-chained-projection) can certainly be used within a [Collection projection](/v1/docs/en/core-collection-projection) to "bundle" multi-value return values from the chain as a list value. - In addition, all types of [Joins](/v1/docs/en/core-abstract-join) can be linked in order to include "external" content in the context of the chain. **NOTE:** If multiple [Chained projection](/v1/docs/en/core-chained-projection) instances are used within the same search that contain similar [Joins](/v1/docs/en/core-abstract-join), these are not created redundantly in the database query. Instead, a shared join is accessed multiple times even if each [Chained projection](/v1/docs/en/core-chained-projection) uses a different name for the "Join alias". However, redundant joins are used if a [Chained projection](/v1/docs/en/core-chained-projection) contains a join whose configuration is identical to an explicit configuration in the "Joins" enumeration of the search. ## Configuration | Parameter | Type | Description | | --- | --- | --- | | **Name** | `String` | The optional **Name** parameter can be used to assign an (alias) name to the projection. - If no **Name** is specified, the name applicable to the last element of the chain (for [Joins](/v1/docs/en/core-abstract-join): the "Join alias") is used as the column name (if relevant). | | *Chain* | *Elements* *(*[Projections](/v1/docs/en/core-i-search-projection) *and/or* [Joins](/v1/docs/en/core-abstract-join)*)* | The chain is always initially empty (see screenshot above), which causes an error (`NullPointerException`) at runtime. Clicking on the large ![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/add(35).svg) icon opens a context menu that offers all [Joins](/v1/docs/en/core-abstract-join) and the applicable [Projections](/v1/docs/en/core-i-search-projection) for selection. For elements of an existing chain, a small ![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/add(35).svg) icon appears at the bottom and top edge when the mouse cursor is moved closer (see screenshot on the left). This can be used to open the same context menu in order to attach an additional element at the respective position or insert it into the chain. To remove elements from an existing chain, the "Remove value" functions in the context menu can be used. The context menu also offers the usual "operators" for the clipboard ("Cut", "Copy" and *after copying or cutting* also "Paste") of **Lobster Data Platform/Orchestration**, which can be applied to individual elements of the chain. Regardless of the number of elements in the chain, the last element of the chain defines the return value. | | ![images/download/attachments/162409422/image-2023-12-12_17-49-19-version-1-modificationdate-1702399759528-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-12-12_17-49-19-version-1-modificationdate-1702399759528-api-v2.png) | ## Examples ### Simple example: Adding the "owner" account of an entity In a tuple search for any entity type, the complete company account for its "owner" is output as the complex value of a column. Configuration: | The screenshot on the right shows a [Chained projection](/v1/docs/en/core-chained-projection) that contains a [Entity join](/v1/docs/en/core-entity-join) as the only element with the following parameterization: - As an **Entity**, the entity type "Company account" (`CompanyAccount`) is selected. - The **Join alias** owner is also used here as the name for the output column, as the higher-level [Chained projection](/v1/docs/en/core-chained-projection) does not provide a **Name**. - The **On** condition is a [Field restriction](/v1/docs/en/core-property-search) that requires a match (`==`) between the ID of the added company account (`owner.ID`) and the value of the "Owner" (`ownerId`) property for the entity in the context of the search. **NOTE:** As the type hint at the bottom indicates, the [Entity join](/v1/docs/en/core-entity-join) returns a "Company account" (if available), which also applies to the [Chained projection](/v1/docs/en/core-chained-projection) as a whole due to the lack of a successor element. | ![images/download/attachments/162409422/image-2023-12-13_7-49-53-version-1-modificationdate-1702450194658-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-12-13_7-49-53-version-1-modificationdate-1702450194658-api-v2.png) | | --- | --- | Variant: Based on the previous use case, the tuple column should now only identify the "owner" as a chained string with selected address characteristics instead of the entire account. Specifically, the fields "Name" (`name1`) and "Account number" (`accNumber`) should appear separated by an underscore (_). Configuration: | Starting from the [Entity join](/v1/docs/en/core-entity-join) (`owner`) configured as above, which provides the complete company account for the "owner" of the entity, the chain is extended by two [Projections](/v1/docs/en/core-i-search-projection) (as successors) as shown on the right: - The [Property projection](/v1/docs/en/core-property-projection) defines the `address` field as the *reference object* for the subsequent [Concatenated projection](/v1/docs/en/core-concat-projection). - The [Concatenated projection](/v1/docs/en/core-concat-projection) can therefore access the address characteristics directly via several instances of the [Property projection](/v1/docs/en/core-property-projection) with pleasingly compact property paths: - The "Name" property can be accessed directly as `name1`. - The [Literal projection](/v1/docs/en/core-literal-projection) adds the underscore `(_`) as a separator. - The "account number" can be accessed directly as `accNumber`. The [Chained projection](/v1/docs/en/core-chained-projection) now provides text in total. | ![images/download/attachments/162409422/image-2023-12-12_17-52-22-version-1-modificationdate-1702399942807-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-12-12_17-52-22-version-1-modificationdate-1702399942807-api-v2.png) | | --- | --- | ### More complex use case: Identifying the "owner of the owner" Based on the previous example, a further tuple column is to be added, which identifies the owner of the owner company of the entity in the context of the search via its address characteristics according to the "variant" scheme. Configuration: | The [Chained projection](/v1/docs/en/core-chained-projection) shown in the screenshot on the right can be created from a copy of the projection described above as "variant" with the following changes: - A second [Entity join](/v1/docs/en/core-entity-join) is inserted between the [Entity join](/v1/docs/en/core-entity-join) `owner` and the [Property projection](/v1/docs/en/core-property-projection) for the `address` field as a copy of the first. - In addition, the **Name** for the [Chained projection](/v1/docs/en/core-chained-projection) (at the top) should be adapted so that the columns can be distinguished. We name the column `ONE_OVER_ONE` here. > [!NOTE] > **NOTE:** > > The copy of the existing [Entity join](/v1/docs/en/core-entity-join) instance can be used here without changes because the following conditions are met: > > 1. In a chain, the **Join alias** only applies within the relevant join instance. Therefore, both instances can use the same value (`owner`). > 2. The [Property projection](/v1/docs/en/core-property-projection) for the *compare value* (on the right in the [Field restriction](/v1/docs/en/core-property-search) within the **On** condition refers with the same path (`ownerId`) to the return value of the predecessor instance, where it refers to the entity in the context. | ![images/download/attachments/162409422/image-2023-12-12_17-53-42-version-1-modificationdate-1702400022437-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-12-12_17-53-42-version-1-modificationdate-1702400022437-api-v2.png) | | --- | --- | Expansion: The search should now contain a *Where* condition that ensures that at least one of the address characteristics linked in the `ONE_OVER_ONE` projection is filled. Configuration: ![images/download/attachments/162409422/image-2023-12-13_9-20-10-version-1-modificationdate-1702455611502-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-12-13_9-20-10-version-1-modificationdate-1702455611502-api-v2.png) > [!NOTE] > **NOTE:** > > - In the data query, a separate join is not generated for each [Entity join](/v1/docs/en/core-entity-join) instance. This would be "company account" joins only for the `ONE_OVER_ONE` column and the associated "Where" condition. > - Specifically, a `LEFT OUTER JOIN` used several times is implemented for each "company account" level and another one is used to access the associated address. > - By copying, pasting and adapting, the required variants can be "produced" quite easily once a [Chained projection](/v1/docs/en/core-chained-projection) with the two joins has been set up. > - Of course, you could also create the two "company account" joins "centrally" and address each use via two general "Join alias" names (e.g. `owner`, `ownersOwner`). In terms of runtime performance, however, this offers no significant advantage unless both methods are used simultaneously. If only one central definition is created for each "company account" join, the risk of individual adjustments being made to originally identical join configurations is avoided. This could increase the number of joins generated in the database query.