Search code examples
neo4jcypherspring-data-neo4j-4

SDN 4 Neo4j own primary key and id() function


I have added uuid property to my SDN 4 Base entity so now it looks like:

@NodeEntity
public abstract class BaseEntity {

    @GraphId
    private Long id;

    @Index(unique = true, primary = true)
    private Long uuid;

...
}

Right now when I'll use Neo4j Cypher id() function, what value will be taken into account by this id(baseEntity) function - from Long id or Long uuid ?


Solution

  • Cypher's id() function always uses the internal id (what's annotated as the @GraphId) and not any custom id.