Class IdentitySupport

java.lang.Object
org.springframework.data.neo4j.core.mapping.IdentitySupport

@API(status=INTERNAL) public final class IdentitySupport extends Object
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 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 data
      propertyAccessor - An accessor to the entity
      entity - As received via the driver
    • getInternalId

      public static Long getInternalId(org.neo4j.driver.types.Entity entity)
      Parameters:
      entity - The entity container as received from the server.
      Returns:
      The internal id
    • getInternalId

      @Nullable public static Long getInternalId(@NonNull 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.
      Parameters:
      row - A query result row
      Returns:
      An internal id
    • getInternalId

      @Nullable public static String getInternalId(@NonNull org.neo4j.driver.types.MapAccessor queryResult, @Nullable String seed)
    • getStartId

      public static Long getStartId(org.neo4j.driver.types.Relationship relationship)
      Returns the start id of the relationship
      Parameters:
      relationship - A relationship to retrieve the start identity
      Returns:
      An internal id
    • getEndId

      public static Long getEndId(org.neo4j.driver.types.Relationship relationship)
      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)