Interface Neo4jPersistentEntity<T>
- Type Parameters:
T- type of the underlying class
- All Superinterfaces:
Aware, EnvironmentAware, Iterable<Neo4jPersistentProperty>, MutablePersistentEntity<T, Neo4jPersistentProperty>, NodeDescription<T>, PersistentEntity<T, Neo4jPersistentProperty>
@API(status=STABLE,
since="6.0")
public interface Neo4jPersistentEntity<T>
extends MutablePersistentEntity<T, Neo4jPersistentProperty>, NodeDescription<T>
A
PersistentEntity interface with additional
methods for metadata related to Neo4j. Both Spring Data methods
PersistentEntity.doWithProperties(PropertyHandler) and
PersistentEntity.doWithAssociations(AssociationHandler) are aware which field of a class is
meant to be mapped as a property of a node or a relationship or if it is a relationship
(in Spring Data terms: if it is an association).
Note to the outside world, we treat the
@TargetNode annotated
field of a
@RelationshipProperties
annotated class as association. Internally, we treat it as a property
- Since:
- 6.0
- Author:
- Michael J. Simons
-
Field Summary
FieldsModifier and TypeFieldDescriptionTypes that are bound to Neo4j id() and are officially deprecated from Neo4j. -
Method Summary
Modifier and TypeMethodDescriptionA collection liked property containing labels to be stored dynamically with this entity.Will return the single supported vector property ifhasVectorProperty()returns true, otherwise it will throw anIllegalStateException.@Nullable Neo4jPersistentPropertyWill return the single supported vector property ifhasVectorProperty()returns true, otherwise null.booleanDetermines if the entity is annotated withRelationshipPropertiesand has the flagRelationshipProperties.persistTypeInfo()set to true.booleanReturns true if this entity spots a vector property.booleanDetermines if the entity is annotated withRelationshipProperties.default booleanChecks if this entity is using deprecated internal ids anywhere in its hierarchy.Methods inherited from interface EnvironmentAware
setEnvironmentMethods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface MutablePersistentEntity
addAssociation, addPersistentProperty, setEvaluationContextProvider, setPersistentPropertyAccessorFactory, verifyMethods inherited from interface NodeDescription
addChildNodeDescription, containsPossibleCircles, describesInterface, getAdditionalLabels, getAggregateBoundaries, getChildNodeDescriptionsInHierarchy, getGraphProperties, getGraphPropertiesInHierarchy, getGraphProperty, getIdDescription, getIdExpression, getMostAbstractParentLabel, getParentNodeDescription, getPrimaryLabel, getRelationships, getRelationshipsInHierarchy, getStaticLabels, getUnderlyingClass, hasAggregateBoundaries, isUsingInternalIds, setParentNodeDescriptionMethods inherited from interface PersistentEntity
doWithAll, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getInstanceCreatorMetadata, getName, getPersistentProperties, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getRequiredAnnotation, getRequiredIdProperty, getRequiredPersistentProperty, getRequiredVersionProperty, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, requiresPropertyPopulation
-
Field Details
-
DEPRECATED_GENERATED_ID_TYPES
-
-
Method Details
-
getDynamicLabelsProperty
Optional<Neo4jPersistentProperty> getDynamicLabelsProperty()A collection liked property containing labels to be stored dynamically with this entity.- Returns:
- an optional property pointing to a
Collection<String>containing dynamic "runtime managed" labels.
-
isRelationshipPropertiesEntity
boolean isRelationshipPropertiesEntity()Determines if the entity is annotated withRelationshipProperties.- Returns:
- true if this is a relationship properties class, otherwise false.
-
hasRelationshipPropertyPersistTypeInfoFlag
boolean hasRelationshipPropertyPersistTypeInfoFlag()Determines if the entity is annotated withRelationshipPropertiesand has the flagRelationshipProperties.persistTypeInfo()set to true.- Returns:
- true if this is a relationship properties class and the type info should be persisted, otherwise false.
-
isUsingDeprecatedInternalId
default boolean isUsingDeprecatedInternalId()Checks if this entity is using deprecated internal ids anywhere in its hierarchy.- Returns:
- true if the underlying domain classes uses
id()to compute internally generated ids.
-
hasVectorProperty
boolean hasVectorProperty()Returns true if this entity spots a vector property.- Returns:
- true if this entity spots a vector property
-
getVectorProperty
@Nullable Neo4jPersistentProperty getVectorProperty()Will return the single supported vector property ifhasVectorProperty()returns true, otherwise null.- Returns:
- an optional vector property on this entity
-
getRequiredVectorProperty
Neo4jPersistentProperty getRequiredVectorProperty()Will return the single supported vector property ifhasVectorProperty()returns true, otherwise it will throw anIllegalStateException.- Returns:
- the vector property on this entity.
-