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) Checks if the mapping contains possible circles.booleanChecks if is an entity for an interface.Returns the list of all additional labels (All labels except the *getPrimaryLabel()).Retrieve all direct child node descriptions which extend this entity.Returns a collection of persistent properties that are mapped to graph properties * and not to relationships.Returns all graph properties including all properties from the extending classes if * this entity is a parent entity.getGraphProperty(String fieldName) Retrieves aGraphPropertyDescriptionby its field name.@Nullable IdDescriptionReturns a description how to determine primary ids for nodes fitting this.default org.neo4j.cypherdsl.core.ExpressionCreates the right identifier expression for this node entity.getMostAbstractParentLabel(NodeDescription<?> mostAbstractNodeDescription) @Nullable NodeDescription<?> Returns the primary label of this entity inside Neo4j.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.Returns the list of all static labels, that is the union of *getPrimaryLabel()+getAdditionalLabels().Returns the concrete class to which a node with the given.default booleanhasAggregateBoundaries(Class<?> domainType) default booleanReturns true if entities for this node use Neo4j internal ids.voidsetParentNodeDescription(NodeDescription<?> parent) Register the direct parent node description.
-
Method Details
-
getPrimaryLabel
String getPrimaryLabel()Returns the primary label of this entity inside Neo4j.- Returns:
- the primary label of this entity inside Neo4j
-
getMostAbstractParentLabel
-
getAdditionalLabels
Returns the list of all additional labels (All labels except the *getPrimaryLabel()).- Returns:
- the list of all additional labels
-
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
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
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.- 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.
-
getParentNodeDescription
@Nullable NodeDescription<?> getParentNodeDescription() -
setParentNodeDescription
Register the direct parent node description.- Parameters:
parent- -NodeDescriptionthat 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
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
-
getAggregateBoundaries
-