Module spring.data.neo4j
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 Summary
Modifier and TypeMethodDescriptionvoidaddChildNodeDescription(NodeDescription<?> child) Register a direct child node description for this entity.booleancontainsPossibleCircles(Predicate<PropertyFilter.RelaxedPropertyPath> includeField) booleanRetrieve all direct child node descriptions which extend this entity.getGraphProperty(String fieldName) Retrieves aGraphPropertyDescriptionby its field name.default org.neo4j.cypherdsl.core.ExpressionCreates the right identifier expression for this node entity.getMostAbstractParentLabel(NodeDescription<?> mostAbstractNodeDescription) This returns the outgoing relationships this node has to other nodes.getRelationshipsInHierarchy(Predicate<PropertyFilter.RelaxedPropertyPath> propertyPredicate) This returns the relationships this node, its parent and child has to other nodes.default booleanvoidsetParentNodeDescription(NodeDescription<?> parent) Register the direct parent node description.
-
Method Details
-
getPrimaryLabel
String getPrimaryLabel()- Returns:
- The primary label of this entity inside Neo4j.
-
getMostAbstractParentLabel
-
getAdditionalLabels
- Returns:
- the list of all additional labels (All labels except the
getPrimaryLabel()).
-
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
- Returns:
- The concrete class to which a node with the given
getPrimaryLabel()is mapped to
-
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
Retrieves aGraphPropertyDescriptionby 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
Register a direct child node description for this entity.- Parameters:
child- -NodeDescriptionthat 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
Register the direct parent node description.- Parameters:
parent- -NodeDescriptionthat describes the parent entity.
-
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
- 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
-