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.
      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()).
      Returns:
      the list of all additional labels
    • 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.
      Returns:
      the list of all static labels
      Since:
      6.0
    • getUnderlyingClass

      Class<T> getUnderlyingClass()
      Returns the concrete class to which a node with the given.
      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.
      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.
      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.
      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.
      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.
    • getParentNodeDescription

      @Nullable NodeDescription<?> getParentNodeDescription()
    • setParentNodeDescription

      void setParentNodeDescription(NodeDescription<?> parent)
      Register the direct parent node description.
      Parameters:
      parent - - NodeDescription that describes the parent entity.
    • 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)
      Checks if the mapping contains possible circles.
      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()
      Checks if is an entity for an interface.
      Returns:
      true if this persistent entity has been created for an interface
      Since:
      6.0.8
    • hasAggregateBoundaries

      default boolean hasAggregateBoundaries(Class<?> domainType)
    • getAggregateBoundaries

      List<Class<?>> getAggregateBoundaries()