Interface NodeDescription<T>

Type Parameters:
T - The type of the underlying class
All Known Subinterfaces:
Neo4jPersistentEntity<T>

@API(status=STABLE, since="6.0") public interface NodeDescription<T>
Describes how a class is mapped to a node inside the database. It provides navigable links to relationships and access to the nodes properties.
Since:
6.0
Author:
Michael J. Simons
  • Method Details

    • getPrimaryLabel

      String getPrimaryLabel()
      Returns:
      The primary label of this entity inside Neo4j.
    • getMostAbstractParentLabel

      String getMostAbstractParentLabel(NodeDescription<?> mostAbstractNodeDescription)
    • getAdditionalLabels

      List<String> getAdditionalLabels()
      Returns:
      the list of all additional labels (All labels except the getPrimaryLabel()).
    • getStaticLabels

      default List<String> getStaticLabels()
      Returns:
      The list of all static labels, that is the union of getPrimaryLabel() + getAdditionalLabels(). Order is guaranteed to be the primary first, then the others.
      Since:
      6.0
    • getUnderlyingClass

      Class<T> getUnderlyingClass()
      Returns:
      The concrete class to which a node with the given getPrimaryLabel() is mapped to
    • getIdDescription

      @Nullable IdDescription getIdDescription()
      Returns:
      A description how to determine primary ids for nodes fitting this description
    • getGraphProperties

      Collection<GraphPropertyDescription> getGraphProperties()
      Returns:
      A collection of persistent properties that are mapped to graph properties and not to relationships
    • getGraphPropertiesInHierarchy

      Collection<GraphPropertyDescription> getGraphPropertiesInHierarchy()
      Returns:
      All graph properties including all properties from the extending classes if this entity is a parent entity.
    • getGraphProperty

      Optional<GraphPropertyDescription> getGraphProperty(String fieldName)
      Retrieves a GraphPropertyDescription by its field name.
      Parameters:
      fieldName - The field name for which the graph property description should be retrieved
      Returns:
      An empty optional if there is no property known for the given field.
    • isUsingInternalIds

      default boolean isUsingInternalIds()
      Returns:
      True if entities for this node use Neo4j internal ids.
    • getRelationships

      Collection<RelationshipDescription> getRelationships()
      This returns the outgoing relationships this node has to other nodes.
      Returns:
      The relationships defined by instances of this node.
    • getRelationshipsInHierarchy

      Collection<RelationshipDescription> getRelationshipsInHierarchy(Predicate<PropertyFilter.RelaxedPropertyPath> propertyPredicate)
      This returns the relationships this node, its parent and child has to other nodes.
      Parameters:
      propertyPredicate - - Predicate to filter the fields on this node description to
      Returns:
      The relationships defined by instances of this node.
    • addChildNodeDescription

      void addChildNodeDescription(NodeDescription<?> child)
      Register a direct child node description for this entity.
      Parameters:
      child - - NodeDescription that defines an extending class.
    • getChildNodeDescriptionsInHierarchy

      Collection<NodeDescription<?>> getChildNodeDescriptionsInHierarchy()
      Retrieve all direct child node descriptions which extend this entity.
      Returns:
      all direct child node description.
    • setParentNodeDescription

      void setParentNodeDescription(NodeDescription<?> parent)
      Register the direct parent node description.
      Parameters:
      parent - - NodeDescription that describes the parent entity.
    • getParentNodeDescription

      @Nullable NodeDescription<?> getParentNodeDescription()
    • getIdExpression

      default org.neo4j.cypherdsl.core.Expression getIdExpression()
      Creates the right identifier expression for this node entity. Note: The expression gets cached and won't get recalculated at every invocation.
      Returns:
      An expression that represents the right identifier type.
    • containsPossibleCircles

      boolean containsPossibleCircles(Predicate<PropertyFilter.RelaxedPropertyPath> includeField)
      Parameters:
      includeField - A predicate used to determine the properties that need to be looked at while detecting possible circles.
      Returns:
      True if the domain would contain schema circles.
    • describesInterface

      boolean describesInterface()
      Returns:
      True if this persistent entity has been created for an interface.
      Since:
      6.0.8