Class NestedRelationshipProcessingStateMachine
java.lang.Object
org.springframework.data.neo4j.core.mapping.NestedRelationshipProcessingStateMachine
@API(status=INTERNAL,
since="6.0")
public final class NestedRelationshipProcessingStateMachine
extends Object
This stores all processed nested relations and objects during save of objects so that the recursive descent can be
stopped accordingly.
- Author:
- Michael J. Simons
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Valid processing states. -
Constructor Summary
ConstructorDescriptionNestedRelationshipProcessingStateMachine
(Neo4jMappingContext mappingContext) NestedRelationshipProcessingStateMachine
(Neo4jMappingContext mappingContext, Object initialObject, Long internalId) -
Method Summary
Modifier and TypeMethodDescriptiongetInternalId
(Object object) getProcessedAs
(Object entity) getStateOf
(Object fromId, RelationshipDescription relationshipDescription, Collection<?> valuesToStore) boolean
hasProcessedRelationship
(Object fromId, RelationshipDescription relationshipDescription) Checks if the relationship has already been processed.boolean
hasProcessedValue
(Object value) Checks if the value has already been processed.void
markRelationshipAsProcessed
(Object fromId, RelationshipDescription relationshipDescription) Marks the passed objects as processedvoid
markValueAsProcessed
(Object valueToStore, Long internalId) Marks the passed objects as processedvoid
markValueAsProcessedAs
(Object valueToStore, Object bean)
-
Constructor Details
-
NestedRelationshipProcessingStateMachine
-
NestedRelationshipProcessingStateMachine
public NestedRelationshipProcessingStateMachine(Neo4jMappingContext mappingContext, Object initialObject, Long internalId)
-
-
Method Details
-
getStateOf
public NestedRelationshipProcessingStateMachine.ProcessState getStateOf(Object fromId, RelationshipDescription relationshipDescription, @Nullable Collection<?> valuesToStore) - Parameters:
relationshipDescription
- Check whether this relationship description has been processedvaluesToStore
- Check whether all the values in the collection have been processed- Returns:
- The state of things processed
-
markRelationshipAsProcessed
public void markRelationshipAsProcessed(Object fromId, @Nullable RelationshipDescription relationshipDescription) Marks the passed objects as processed- Parameters:
relationshipDescription
- To be marked as processed
-
markValueAsProcessed
Marks the passed objects as processed- Parameters:
valueToStore
- If not null, all non-null values will be marked as processedinternalId
- The internal id of the value processed
-
hasProcessedValue
Checks if the value has already been processed.- Parameters:
value
- the object that should be looked for in the registry.- Returns:
- processed yes (true) / no (false)
-
hasProcessedRelationship
public boolean hasProcessedRelationship(Object fromId, @Nullable RelationshipDescription relationshipDescription) Checks if the relationship has already been processed.- Parameters:
relationshipDescription
- the relationship that should be looked for in the registry.- Returns:
- processed yes (true) / no (false)
-
markValueAsProcessedAs
-
getInternalId
-
getProcessedAs
-