Class IdDescription

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

@API(status=INTERNAL, since="6.0") public final class IdDescription extends Object
Description how to generate Ids for entities.
Since:
6.0
Author:
Michael J. Simons
  • Method Details

    • forAssignedIds

      public static IdDescription forAssignedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName, String graphPropertyName)
    • forInternallyGeneratedIds

      public static IdDescription forInternallyGeneratedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName)
    • forExternallyGeneratedIds

      public static IdDescription forExternallyGeneratedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName, @Nullable Class<? extends IdGenerator<?>> idGeneratorClass, @Nullable String idGeneratorRef, String graphPropertyName)
    • asIdExpression

      public org.neo4j.cypherdsl.core.Expression asIdExpression()
    • getIdGeneratorClass

      public Optional<Class<? extends IdGenerator<?>>> getIdGeneratorClass()
    • getIdGeneratorRef

      public Optional<String> getIdGeneratorRef()
    • isAssignedId

      public boolean isAssignedId()
      Returns:
      True, if the ID is assigned to the entity before the entity hits the database, either manually or through a generator.
    • isInternallyGeneratedId

      public boolean isInternallyGeneratedId()
      Returns:
      True, if the database generated the ID.
    • isExternallyGeneratedId

      public boolean isExternallyGeneratedId()
      Returns:
      True, if the ID is externally generated.
    • getOptionalGraphPropertyName

      public Optional<String> getOptionalGraphPropertyName()
      An ID description has only a corresponding graph property name when it's bas on an external assigment. An internal id has no corresponding graph property and therefore this method will return an empty Optional in such cases.
      Returns:
      The name of an optional graph property.