Package com.orchestranetworks.schema.relationships

# Interface SchemaNodeExplicitRelationship

All Known Subinterfaces:
  `AssociationLink`, `AssociationLinkByLinkTable`, `AssociationLinkByTableRefInverse`, `AssociationLinkByXPathLink`, `SchemaFacetTableRef`, `SelectionLink`

public interface SchemaNodeExplicitRelationship
This interface represents a relationship defined in a resolved data model. A relationship is either a foreign key constraint, a selection link or an association link.

Since:
  5.7.1
See Also:
  - `getResult(Adaptation, Session)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SchemaNodeBreadcrumbProperties`
  `getBreadcrumbProperties()`
  Returns the properties defined in the data model (property `breadcrumb`) related to the breadcrumb displayed in the user interface.
  `HomeKey`
  `getContainerHome()`
  Returns the reference of the dataspace of this link, if an external dataset in another dataspace is defined by the data model, otherwise returns `null`.
  `AdaptationReference`
  `getContainerReference()`
  Returns the reference of the dataset of this link, if an external dataset is defined in the data model, otherwise returns `null`.
  `ExplicitRelationship`
  `getExplicitRelationship()`
  Returns the `ExplicitRelationship` object associated with this relationship.
  `ExplicitRelationship`
  `getExplicitRelationship(Adaptation aDataset, Session aSession)`
  Returns the `ExplicitRelationship` object associated with this relationship.
  `SchemaNode`
  `getOwnerNode()`
  Returns the node in the data model that defines the explicit relationship.
  `RequestResult`
  `getResult(Adaptation aRecord, Session aSessionOrNull)`
  Returns the result of this relationship, in the context of the specified record.
  `SchemaNode`
  `getTableNode()`
  Returns the table node referred to by this link.
  `SchemaNode`
  `getTableNode(Adaptation aDataset)`
  Returns the table node referred to by this link in the context of the specified dataset.
  `boolean`
  `isAssociationLink()`
  Returns `true` if this relationship is an association link.
  `boolean`
  `isDynamic()`
  Returns `true` if this relationship refers to a dataset that is not statically defined in the data model.
  `boolean`
  `isSelectionLink()`
  Returns `true` if this relationship is a selection link.
  `boolean`
  `isTableRefLink()`
  Returns `true` if this relationship is a foreign key constraint.

- ## Method Details

  - ### isTableRefLink

    boolean isTableRefLink()
    Returns `true` if this relationship is a foreign key constraint.
    See Also:
      - `SchemaFacetTableRef`

  - ### isAssociationLink

    boolean isAssociationLink()
    Returns `true` if this relationship is an association link.
    See Also:
      - `AssociationLink`

  - ### isSelectionLink

    boolean isSelectionLink()
    Returns `true` if this relationship is a selection link.
    See Also:
      - `SelectionLink`

  - ### getOwnerNode

    SchemaNode getOwnerNode()
    Returns the node in the data model that defines the explicit relationship.

  - ### getExplicitRelationship

    ExplicitRelationship getExplicitRelationship(Adaptation aDataset, Session aSession)
    Returns the `ExplicitRelationship` object associated with this relationship.

    Permissions are resolved using this method. As a consequence, this method returns `null` if this relationship cannot be viewed by the end-user associated with the given session and in the context of the specified dataset. See `SchemaNodeRelationships.getExplicitRelationships()` for more information about the resolution of the permissions.

    Throws:
      `IllegalArgumentException` - if the specified `Adaptation` is `null`.
      `IllegalArgumentException` - if the specified `Adaptation` is not a dataset.
      `IllegalStateException` - if the specified `Adaptation` has a severe error.
      `IllegalStateException` - if the specified dataset is not an instance of the data model containing this node.
      `IllegalArgumentException` - if the specified `Session` is `null`.
    See Also:
      - `SchemaNodeRelationships.getExplicitRelationships()`

  - ### getExplicitRelationship

    ExplicitRelationship getExplicitRelationship()
    Returns the `ExplicitRelationship` object associated with this relationship. Permissions are not resolved using this method.
    See Also:
      - `getExplicitRelationship(Adaptation, Session)`

  - ### getResult

    RequestResult getResult(Adaptation aRecord, Session aSessionOrNull) throws QueryPermissionException
    Returns the result of this relationship, in the context of the specified record.

    This method never returns `null`, even if it has no results in the context of the specified record.

    Returned result does not contain duplicate records.

    If a session is specified, permissions are applied according to the specified session. As a consequence:

    - the returned records will be filtered using the access rules on records if any;
    - a `QueryPermissionException` will be thrown on execution if at least one forbidden node is used in the request.
    Throws:
      `QueryPermissionException` - if a Session is provided and at least one forbidden node is used in the request.
    See Also:
      - `SchemaFacetTableRef.getLinkedRecords(Adaptation)`
      - `SelectionLink.getSelectionResult(Adaptation)`
      - `AssociationLink.getAssociationResult(Adaptation)`

  - ### getContainerReference

    AdaptationReference getContainerReference()
    Returns the reference of the dataset of this link, if an external dataset is defined in the data model, otherwise returns `null`.

  - ### getContainerHome

    HomeKey getContainerHome()
    Returns the reference of the dataspace of this link, if an external dataset in another dataspace is defined by the data model, otherwise returns `null`.

  - ### getTableNode

    SchemaNode getTableNode()
    Returns the table node referred to by this link.

    Returns `null` if this link refers to a table in another dataset that is not statically defined in the data model. In this case the target table must be resolved in the context of a specific dataset.

    See Also:
      - `getTableNode(Adaptation)`
      - `isDynamic()`

  - ### getTableNode

    SchemaNode getTableNode(Adaptation aDataset)
    Returns the table node referred to by this link in the context of the specified dataset.
    Throws:
      `IllegalArgumentException` - if the specified `Adaptation` is `null`.
      `IllegalArgumentException` - if the specified `Adaptation` is not a dataset.
      `IllegalStateException` - if the specified `Adaptation` has a severe error.
      `IllegalStateException` - if the specified dataset is not an instance of the data model containing this node.
    See Also:
      - `getTableNode()`
      - `isDynamic()`

  - ### isDynamic

    boolean isDynamic()
    Returns `true` if this relationship refers to a dataset that is not statically defined in the data model. This kind of relationship can be added dynamically by a data model extension.

  - ### getBreadcrumbProperties

    SchemaNodeBreadcrumbProperties getBreadcrumbProperties()
    Returns the properties defined in the data model (property `breadcrumb`) related to the breadcrumb displayed in the user interface.
    Since:
      6.0