Class IdentitySupport
java.lang.Object
org.springframework.data.neo4j.core.mapping.IdentitySupport
This class is not part of any public API and will be changed without further notice as needed. It's
primary goal is to mitigate the changes in Neo4j5, which introduces the notion of an element id for both nodes
and relationships while deprecating id at the same time. The identity support allows to isolate our calls
deprecated API in one central place and will exists for SDN 7 only to make SDN 7 work with both Neo4j 4.4 and Neo4j 5.x.
- Since:
- 7.0
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionstatic Long
getEndId
(org.neo4j.driver.types.Relationship relationship) Returns the end id of the relationshipstatic Long
getInternalId
(org.neo4j.driver.types.Entity entity) static Long
getInternalId
(org.neo4j.driver.types.MapAccessor row) Retrieves an identity either from attributes inside the row or if it is an actual entity, with the dedicated accessors.static String
getInternalId
(org.neo4j.driver.types.MapAccessor queryResult, String seed) static Long
getInternalId
(org.neo4j.driver.types.TypeSystem typeSystem, org.neo4j.driver.Record row) static Long
getStartId
(org.neo4j.driver.types.Relationship relationship) Returns the start id of the relationshipstatic void
updateInternalId
(Neo4jPersistentEntity<?> entityMetaData, PersistentPropertyAccessor<?> propertyAccessor, org.neo4j.driver.types.Entity entity) Updates the internal id of a given client side entity from a server side entity using a property accessor.
-
Method Details
-
updateInternalId
public static void updateInternalId(Neo4jPersistentEntity<?> entityMetaData, PersistentPropertyAccessor<?> propertyAccessor, org.neo4j.driver.types.Entity entity) Updates the internal id of a given client side entity from a server side entity using a property accessor. Does nothing if the local entity does not use internally generated ids.- Parameters:
entityMetaData
- The entity's meta datapropertyAccessor
- An accessor to the entityentity
- As received via the driver
-
getInternalId
- Parameters:
entity
- The entity container as received from the server.- Returns:
- The internal id
-
getInternalId
Retrieves an identity either from attributes inside the row or if it is an actual entity, with the dedicated accessors.- Parameters:
row
- A query result row- Returns:
- An internal id
-
getInternalId
-
getStartId
Returns the start id of the relationship- Parameters:
relationship
- A relationship to retrieve the start identity- Returns:
- An internal id
-
getEndId
Returns the end id of the relationship- Parameters:
relationship
- A relationship to retrieve the end identity- Returns:
- An internal id
-
getInternalId
public static Long getInternalId(org.neo4j.driver.types.TypeSystem typeSystem, org.neo4j.driver.Record row)
-