Interface RelationshipDescription


@API(status=INTERNAL, since="6.0") public interface RelationshipDescription
Description of a relationship. Those descriptions always describe outgoing relationships. The inverse direction is maybe defined on the NodeDescription reachable in the Schema via it's primary label defined by getTarget().
Since:
6.0
Author:
Michael J. Simons
  • Field Details

  • Method Details

    • getType

      String getType()
      If this relationship is dynamic, then this method always returns the name of the inverse property.
      Returns:
      The type of this relationship
    • isDynamic

      boolean isDynamic()
      A relationship is dynamic when it's modelled as a Map<String, ?>.
      Returns:
      True, if this relationship is dynamic
    • getSource

      NodeDescription<?> getSource()
      The source of this relationship is described by the primary label of the node in question.
      Returns:
      The source of this relationship
    • getTarget

      NodeDescription<?> getTarget()
      The target of this relationship is described by the primary label of the node in question. If the relationship description includes a relationship properties class, this will be the NodeDescription of the TargetNode.
      Returns:
      The target of this relationship
    • getFieldName

      String getFieldName()
      The name of the property where the relationship was defined. This is used by the Cypher creation to name the return values.
      Returns:
      The name of the field storing the relationship property
    • getDirection

      Relationship.Direction getDirection()
      The direction of the defined relationship. This is used by the Cypher creation to query for relationships and create them with the right directions.
      Returns:
      The direction of the relationship
    • getRelationshipPropertiesEntity

      @Nullable NodeDescription<?> getRelationshipPropertiesEntity()
      If this is a relationship with properties, the properties-defining class will get returned, otherwise null.
      Returns:
      The type of the relationship property class for relationship with properties, otherwise null
    • hasRelationshipProperties

      boolean hasRelationshipProperties()
      Tells if this relationship is a relationship with additional properties. In such cases getRelationshipPropertiesClass will return the type of the properties holding class.
      Returns:
      true if an additional properties are available, otherwise false
    • hasInternalIdProperty

      default boolean hasInternalIdProperty()
    • isOutgoing

      default boolean isOutgoing()
    • isIncoming

      default boolean isIncoming()
    • generateRelatedNodesCollectionName

      @NonNull default String generateRelatedNodesCollectionName(NodeDescription<?> mostAbstractNodeDescription)
    • setRelationshipObverse

      void setRelationshipObverse(RelationshipDescription relationshipObverse)
      Set the relationship definition that describes the opposite side of the relationship.
      Parameters:
      relationshipObverse - logically same relationship definition in the target entity
    • getRelationshipObverse

      RelationshipDescription getRelationshipObverse()
      Returns:
      logically same relationship definition in the target entity
    • hasRelationshipObverse

      boolean hasRelationshipObverse()
      Checks if there is a relationship description describing the obverse of this relationship.
      Returns:
      true if a logically same relationship in the target entity exists, otherwise false.