Skip to content

Commit a952f7e

Browse files
committed
Update documentation to reflect the elementId changes.
Also add a link to the release notes for *this* version.
1 parent d8bff18 commit a952f7e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/asciidoc/introduction-and-preface/new-and-noteworthy.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[[new-and-noteworthy]]
22
= New & Noteworthy
33

4+
* https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2023.0-(Ullman)-Release-Notes#spring-data-neo4j---71[Release notes for Spring Data Neo4j version 7.1]
45
* https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2022.0-(Turing)-Release-Notes#spring-data-neo4j--70[Release notes for Spring Data Neo4j version 7.0]
56
* https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2021.2-(Raj)-Release-Notes#spring-data-neo4j---63[Release notes for Spring Data Neo4j version 6.3]
67
* https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2021.1-(Q)-Release-Notes#spring-data-neo4j---62[Release notes for Spring Data Neo4j version 6.2]

src/main/asciidoc/object-mapping/mapping.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ Peoples names for example are seldom unique, change over time or worse, not ever
160160

161161
We therefore support two different kind of _surrogate keys_.
162162

163-
On an attribute of type `long` or `Long`, `@Id` can be used with `@GeneratedValue`.
164-
This maps the Neo4j internal id, which is *not* a property on a node or relationship and usually not visible, to the attribute and allows SDN to retrieve individual instances of the class.
163+
On an attribute of type `String`, `long` or `Long`, `@Id` can be used with `@GeneratedValue`.
164+
`Long` and `long` maps to the Neo4j internal id.
165+
`String` maps to the _elementId_ that is available since Neo4j 5.
166+
Both are *not* a property on a node or relationship and usually not visible, to the attribute and allows SDN to retrieve individual instances of the class.
165167

166168
`@GeneratedValue` provides the attribute `generatorClass`.
167169
`generatorClass` can be used to specify a class implementing `IdGenerator`.
@@ -300,7 +302,7 @@ you can define a fine-grained description of the data that you want to fetch by
300302
=== Using the internal Neo4j id
301303

302304
The easiest way to give your domain classes a unique identifier is the combination of `@Id` and `@GeneratedValue`
303-
on a field of type `Long` (preferable the object, not the scalar `long`, as literal `null` is the better indicator whether an instance is new or not):
305+
on a field of type `String` or `Long` (preferable the object, not the scalar `long`, as literal `null` is the better indicator whether an instance is new or not):
304306

305307
.Mutable MovieEntity with internal Neo4j id
306308
====

0 commit comments

Comments
 (0)