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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if updates should be cascaded along this relationship.default String
generateRelatedNodesCollectionName
(NodeDescription<?> mostAbstractNodeDescription) The direction of the defined relationship.The name of the property where the relationship was defined.If this is a relationship with properties, the properties-defining class will get returned, otherwise null.The source of this relationship is described by the primary label of the node in question.The target of this relationship is described by the primary label of the node in question.getType()
If this relationship is dynamic, then this method always returns the name of the inverse property.default boolean
boolean
Checks if there is a relationship description describing the obverse of this relationship.boolean
Tells if this relationship is a relationship with additional properties.boolean
A relationship is dynamic when it's modelled as aMap<String, ?>
.default boolean
default boolean
void
setRelationshipObverse
(RelationshipDescription relationshipObverse) Set the relationship definition that describes the opposite side of the relationship.
-
Field Details
-
NAME_OF_RELATIONSHIP
- See Also:
-
NAME_OF_RELATIONSHIP_TYPE
- See Also:
-
-
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 aMap<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 theNodeDescription
of theTargetNode
.- 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
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 casesgetRelationshipPropertiesClass
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
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.
-
cascadeUpdates
boolean cascadeUpdates()Returns true if updates should be cascaded along this relationship.- Returns:
- true if updates should be cascaded along this relationship
-