Class IdDescription
java.lang.Object
org.springframework.data.neo4j.core.mapping.IdDescription
Description how to generate Ids for entities.
- Since:
- 6.0
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionorg.neo4j.cypherdsl.core.Expressionorg.neo4j.cypherdsl.core.ExpressionasIdExpression(String nodeName) Creates the right identifier expression for this node entity.static IdDescriptionforAssignedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName, String graphPropertyName) static IdDescriptionforExternallyGeneratedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName, Class<? extends IdGenerator<?>> idGeneratorClass, String idGeneratorRef, String graphPropertyName) static IdDescriptionforInternallyGeneratedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName) static IdDescriptionforInternallyGeneratedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName, boolean isDeprecated) Optional<Class<? extends IdGenerator<?>>> An ID description has only a corresponding graph property name when it's bas on an external assigment.booleanFlag, if this is an assigned id.booleanFlag, if this is an externally generated id.booleanFlag, if this is a database generated id.
-
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) -
forInternallyGeneratedIds
public static IdDescription forInternallyGeneratedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName, boolean isDeprecated) -
forExternallyGeneratedIds
public static IdDescription forExternallyGeneratedIds(org.neo4j.cypherdsl.core.SymbolicName symbolicName, Class<? extends IdGenerator<?>> idGeneratorClass, String idGeneratorRef, String graphPropertyName) -
asIdExpression
public org.neo4j.cypherdsl.core.Expression asIdExpression() -
asIdExpression
Creates the right identifier expression for this node entity. Note: This enforces a recalculation of the name on invoke.- Parameters:
nodeName- use this name as the symbolic name of the node in the query- Returns:
- an expression that represents the right identifier type
-
getIdGeneratorClass
-
getIdGeneratorRef
-
isAssignedId
public boolean isAssignedId()Flag, if this is an assigned id.- 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()Flag, if this is a database generated id.- Returns:
- true, if the database generated the ID.
-
isExternallyGeneratedId
public boolean isExternallyGeneratedId()Flag, if this is an externally generated id.- Returns:
- true, if the ID is externally generated
-
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 emptyOptionalin such cases.- Returns:
- the name of an optional graph property
-