Skip to content

Commit 7c8733d

Browse files
committed
GH-2651 - Update docs for Neo4j 5.
Closes #2651
1 parent ac38963 commit 7c8733d

File tree

9 files changed

+46
-43
lines changed

9 files changed

+46
-43
lines changed

README.adoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ image:https://spring.io/badges/spring-data-neo4j/ga.svg[Spring Data Neo4j,link=h
99
:groupIdStarter: org.springframework.boot
1010
:artifactIdStarter: spring-boot-starter-data-neo4j
1111

12-
:neo4j-version: 4.1.5
13-
:spring-boot-version: 2.6.3
14-
:spring-data-neo4j-version: 6.2.1
12+
:docs-neo4j-version: 5.3.0
13+
:docs-neo4j-docker-version: 5
14+
:docs-neo4j-4-version: 4.4.16
15+
:docs-neo4j-3-version: 3.5.23
16+
:spring-boot-version: 3.0.1
17+
:spring-data-neo4j-version: 7.0.1
1518
// end::properties[]
1619

1720
[abstract]

src/main/asciidoc/appendix/build.adoc

+13-14
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44
[[building-SDN.requirements]]
55
== Requirements
66

7-
* JDK 8+ (Can be https://openjdk.java.net[OpenJDK] or https://www.oracle.com/technetwork/java/index.html[Oracle JDK])
8-
* Maven 3.6.2 (We provide the Maven wrapper, see `mvnw` respectively `mvnw.cmd` in the project root; the wrapper downloads the appropriate Maven version automatically)
9-
* A Neo4j 3.5.+ database, either
7+
* JDK 17+ (Can be https://openjdk.java.net[OpenJDK] or https://www.oracle.com/technetwork/java/index.html[Oracle JDK])
8+
* Maven 3.8.5 (We provide the Maven wrapper, see `mvnw` respectively `mvnw.cmd` in the project root; the wrapper downloads the appropriate Maven version automatically)
9+
* A Neo4j 5.+ database, either
1010
** running locally
1111
** or indirectly via https://www.testcontainers.org[Testcontainers] and https://www.docker.com[Docker]
1212

1313
[[building-SDN.jdk.version]]
1414
=== About the JDK version
1515

16-
Choosing JDK 8 is a decision influenced by various aspects
16+
Choosing JDK 17 is a decision influenced by various aspects
1717

1818
* SDN is a Spring Data project.
19-
Spring Data commons baseline is still JDK 8 and so is Spring Framework's baseline.
20-
Thus, it is only natural to keep the JDK 8 baseline.
21-
* While there is an increase of projects started with JDK 11 (which is Oracle's current LTS release of Java), many existing projects are still on JDK 8. We don't want to lose them as users right from the start.
19+
Spring Data commons baseline is JDK 17 and so is Spring Framework's baseline.
20+
Thus, it is only natural to keep the JDK 17 baseline.
2221

2322
[[building-SDN.running-the-build]]
2423
== Running the build
@@ -42,9 +41,9 @@ The output should be similar:
4241
.Verify your JDK
4342
----
4443
$ java -version
45-
java version "12.0.1" 2019-04-16
46-
Java(TM) SE Runtime Environment (build 12.0.1+12)
47-
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)
44+
java version "18.0.1" 2022-04-19
45+
Java(TM) SE Runtime Environment (build 18.0.1+10-24)
46+
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1+10-24, mixed mode, sharing)
4847
----
4948

5049
[[building-SDN.docker]]
@@ -85,10 +84,10 @@ The image version to use can be configured through an environmental variable lik
8584
[[build-other-image]]
8685
.Build using a different Neo4j Docker image
8786
----
88-
$ SDN_NEO4J_VERSION=3.5.11-enterprise SDN_NEO4J_ACCEPT_COMMERCIAL_EDITION=yes ./mvnw clean verify
87+
$ SDN_NEO4J_VERSION=5.3.0-enterprise SDN_NEO4J_ACCEPT_COMMERCIAL_EDITION=yes ./mvnw clean verify
8988
----
9089

91-
Here we are using 3.5.11 enterprise and also accept the license agreement.
90+
Here we are using 5.3.0 enterprise and also accept the license agreement.
9291

9392
Consult your operating system or shell manual on how to define environment variables if specifying them inline does not work for you.
9493

@@ -111,7 +110,7 @@ After that, you can run a complete build by specifying the local `bolt` URL:
111110
[[build-using-locally-running-database]]
112111
.Build using a locally running database
113112
----
114-
$ SDN_NEO4J_URL=bolt://localhost:7687 SDN_NEO4J_PASSWORD=secret ./mvnw clean verify
113+
$ SDN_NEO4J_URL=bolt://localhost:7687 SDN_NEO4J_PASSWORD=verysecret ./mvnw clean verify
115114
----
116115

117116
[[building-SDN.environment-variables]]
@@ -122,7 +121,7 @@ $ SDN_NEO4J_URL=bolt://localhost:7687 SDN_NEO4J_PASSWORD=secret ./mvnw clean ver
122121
|Name|Default value|Meaning
123122

124123
|`SDN_NEO4J_VERSION`
125-
|3.5.6
124+
|5.3.0
126125
|Version of the Neo4j docker image to use, see https://hub.docker.com/_/neo4j[Neo4j Docker Official Images]
127126

128127
|`SDN_NEO4J_ACCEPT_COMMERCIAL_EDITION`

src/main/asciidoc/faq/index.adoc

+14-13
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ Have a look at the corresponding module `org.neo4j.driver:neo4j-java-driver-test
4545
[[faq.change-driver-version]]
4646
== Which Neo4j Java Driver can be used and how?
4747

48-
SDN6 relies on the Neo4j Java Driver version 4.x.
49-
Each SDN6 release uses a Neo4j Java Driver version compatible with the latest Neo4j available at the time of its
48+
SDN relies on the Neo4j Java Driver.
49+
Each SDN release uses a Neo4j Java Driver version compatible with the latest Neo4j available at the time of its
5050
release.
51-
While patch versions of the Neo4j Java Driver are usually drop-in replacements, SDN6 makes sure that even minor versions
51+
While patch versions of the Neo4j Java Driver are usually drop-in replacements, SDN makes sure that even minor versions
5252
are interchangeable as it checks for the presence or absence of methods or interface changes if necessary.
5353

54-
Therefore, you are able to use any 4.x Neo4j Java Driver with any SDN 6.x version.
54+
Therefore, you are able to use any 4.x Neo4j Java Driver with any SDN 6.x version,
55+
and any 5.x Neo4j Driver with any SDN 7.x version.
5556

5657
=== With Spring Boot
5758

@@ -62,7 +63,7 @@ Spring Boots dependency management to change the driver version like this:
6263
[source,xml]
6364
----
6465
<properties>
65-
<neo4j-java-driver.version>4.4.2</neo4j-java-driver.version>
66+
<neo4j-java-driver.version>5.4.0</neo4j-java-driver.version>
6667
</properties>
6768
----
6869

@@ -71,7 +72,7 @@ Or
7172
.Change the driver version from Gradle (gradle.properties)
7273
[source,properties]
7374
----
74-
neo4j-java-driver.version = 4.4.2
75+
neo4j-java-driver.version = 5.4.0
7576
----
7677

7778
=== Without Spring Boot
@@ -85,13 +86,13 @@ section like this:
8586
<dependency>
8687
<groupId>org.neo4j.driver</groupId>
8788
<artifactId>neo4j-java-driver</artifactId>
88-
<version>4.4.2</version>
89+
<version>5.4.0</version>
8990
</dependency>
9091
</dependencyManagement>
9192
----
9293

9394
[[faq.multidatabase]]
94-
== Neo4j 4.0 supports multiple databases - How can I use them?
95+
== Neo4j 4 supports multiple databases - How can I use them?
9596

9697
You can either statically configure the database name or run your own database name provider.
9798
Bear in mind that SDN will not create the databases for you.
@@ -414,7 +415,7 @@ public class Neo4jHealthConfig {
414415
----
415416

416417
[[faq.impersonation]]
417-
== Neo4j 4.4 supports impersonation of different users - How can I use them?
418+
== Neo4j 4.4+ supports impersonation of different users - How can I use them?
418419

419420
User impersonation is especially interesting in big multi-tenant settings, in which one physically connected (or technical)
420421
user can impersonate many tenants. Depending on your setup this will drastically reduce the number of physical driver instances needed.
@@ -1035,7 +1036,7 @@ TIP: Named paths can be used efficiently to populate and return more than just a
10351036

10361037
No, `@Query` is *not* the only way to run custom queries.
10371038
The annotation is comfortable in situations in which your custom query fills your domain completely.
1038-
Please remember that SDN 6 assumes your mapped domain model to be the truth.
1039+
Please remember that SDN assumes your mapped domain model to be the truth.
10391040
That means if you use a custom query via `@Query` that only fills a model partially, you are in danger of using the same
10401041
object to write the data back which will eventually erase or overwrite data you didn't consider in your query.
10411042

@@ -1060,7 +1061,7 @@ If you think that you can solve your problem with a partially dynamic query or a
10601061
please jump back now to the chapter <<sdn-mixins, about Spring Data Neo4j Mixins>>.
10611062

10621063
Otherwise, please read up on two things: <<repositories.custom-implementations,custom repository fragments>>
1063-
the <<sdn-building-blocks,levels of abstractions>> we offer in SDN 6.
1064+
the <<sdn-building-blocks,levels of abstractions>> we offer in SDN.
10641065

10651066
Why speaking about custom repository fragments now?
10661067

@@ -1123,9 +1124,9 @@ The important takeaway here is:
11231124
Often times a custom query indicates custom results.
11241125
Should all of those results be mapped as `@Node`? Of course not! Many times those objects represents read commands
11251126
and are not meant to be used as write commands.
1126-
It is also not unlikely that SDN 6 cannot or want not map everything that is possible with Cypher.
1127+
It is also not unlikely that SDN cannot or want not map everything that is possible with Cypher.
11271128
It does however offer several hooks to run your own mapping: On the `Neo4jClient`.
1128-
The benefit of using the SDN 6 `Neo4jClient` over the driver:
1129+
The benefit of using the SDN `Neo4jClient` over the driver:
11291130

11301131
* The `Neo4jClient` is integrated with Springs transaction management
11311132
* It has a fluent API for binding parameters

src/main/asciidoc/getting-started/getting-started.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If you don't have a running database but Docker installed, please run:
2626
[[start-docker-neo4j]]
2727
.Start a local Neo4j instance inside Docker.
2828
----
29-
docker run --publish=7474:7474 --publish=7687:7687 -e 'NEO4J_AUTH=neo4j/secret' neo4j:{neo4j-version}
29+
docker run --publish=7474:7474 --publish=7687:7687 -e 'NEO4J_AUTH=neo4j/secret' neo4j:{docs-neo4j-docker-version}
3030
----
3131

3232
You can now access http://localhost:7474/browser/?cmd=play&arg=movies[http://localhost:7474].
@@ -113,7 +113,7 @@ Find `application.properties` and configure your Neo4j credentials:
113113
----
114114
spring.neo4j.uri=bolt://localhost:7687
115115
spring.neo4j.authentication.username=neo4j
116-
spring.neo4j.authentication.password=secret
116+
spring.neo4j.authentication.password=verysecret
117117
----
118118

119119
This is the bare minimum of what you need to connect to a Neo4j instance.
@@ -122,7 +122,7 @@ NOTE: It is not necessary to add any programmatic configuration of the driver wh
122122
SDN repositories will be automatically enabled by this starter.
123123

124124
[[running-on-the-module-path]]
125-
== Running on the Module-Path (Java 9+)
125+
== Running on the Module-Path
126126

127127
Spring Data Neo4j can run on the module path. It's automatic module name is `spring.data.neo4j`.
128128
It does not provide a module itself due to restrictions in the current Spring Data build setup.

src/main/asciidoc/index.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ include::{manualIncludeDir}/README.adoc[tags=properties]
2424
:spring-framework-ref: https://docs.spring.io/spring/docs/{springVersion}/reference/html
2525
:spring-data-commons-docs: ../../../../spring-data-commons/src/main/asciidoc
2626

27-
(C) 2008-2021 The original authors.
27+
(C) 2008-2023 The original authors.
2828

2929
NOTE: Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
3030

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Apart from the paging mechanism, all the features of standard repositories are a
3131
If you come from older versions of Spring Data Neo4j - which are usually abbreviated SDN+OGM or SDN5 -
3232
you will most likely be interested in the <<preface.sdn, introduction to SDN>> and especially in the relationship
3333
<<faq.sdn-related-to-ogm, between SDN+OGM and the current SDN>>. In the same chapter, you will find out about the
34-
<<building-blocks, building blocks>> of SDN6.
34+
<<building-blocks, building blocks>> of SDN.
3535

3636
To learn more about the general concepts of repositories, head over to <<repositories>>.
3737

src/main/asciidoc/introduction-and-preface/preface-sdn.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ All of them provide integration with Spring's application level transactions.
3535
On a lower level, you can grab the Bolt driver instance, but than you have to manage your own transactions in these cases.
3636

3737
NOTE: You still can use Neo4j-OGM, even in modern Spring Boot applications.
38-
But you *cannot* use it with SDN 6.
38+
But you *cannot* use it with SDN 6+.
3939
If you tried you would have two different sets of entities in two different - and unrelated - persistence context.
4040
Hence, if you want to stick to Neo4j-OGM 3.2.x, you would use the Java driver instantiated by Spring Boot and pass it onto a Neo4j-OGM session.
4141
Neo4j-OGM 3.2.x is still supported, and we recommend its use in frameworks such as Quarkus.
42-
In a Spring Boot application however your primary choice should be SDN 6.
42+
In a Spring Boot application however your primary choice should be SDN.
4343

4444
Please make sure you read the <<faq, Frequently Asked Questions>> where we address many reoccurring questions about our mapping decisions but also how interaction with Neo4j cluster instances such as https://neo4j.com/cloud/platform/aura-graph-database/[Neo4j AuraDB] and on-premise cluster deployments can be significantly improved.
4545

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Additional mixins provided are:
2828

2929
Both the `QuerydslPredicateExecutor` and `CypherdslConditionExecutor` provide the same concept: SDN generates a query, you
3030
provide "predicates" (Query DSL) or "conditions" (Cypher DSL) that will be added. We recommend the Cypher DSL, as this is
31-
what SDN 6 uses natively. You might even want to consider using the
31+
what SDN uses natively. You might even want to consider using the
3232
http://neo4j-contrib.github.io/cypher-dsl/2021.1.1/#thespringdataneo4j6annotationprocessor[annotation processor] that generates
3333
a static meta model for you.
3434

src/main/asciidoc/testing/testing.adoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ Also, 4.0 requires JDK 11.
104104

105105
You need the following dependencies to run <<dataneo4jtest-harness35-example>>:
106106

107-
[source,xml]
107+
[source,xml,subs="verbatim,+attributes"]
108108
.Neo4j 3.5 test harness dependencies
109109
----
110110
<dependency>
111111
<groupId>org.neo4j.test</groupId>
112112
<artifactId>neo4j-harness</artifactId>
113-
<version>3.5.23</version>
113+
<version>{docs-neo4j-3-version}</version>
114114
<scope>test</scope>
115115
</dependency>
116116
----
@@ -183,13 +183,13 @@ application properties. We overwrite the corresponding Neo4j settings.
183183

184184
You need the following dependencies to run <<dataneo4jtest-harness40-example>>:
185185

186-
[source,xml]
186+
[source,xml,subs="verbatim,attributes"]
187187
.Neo4j 4.x test harness dependencies
188188
----
189189
<dependency>
190190
<groupId>org.neo4j.test</groupId>
191191
<artifactId>neo4j-harness</artifactId>
192-
<version>{neo4j-version}</version>
192+
<version>{docs-neo4j-4-version}</version>
193193
<scope>test</scope>
194194
<exclusions>
195195
<exclusion>
@@ -277,7 +277,7 @@ You need the following dependencies:
277277
<dependency>
278278
<groupId>org.testcontainers</groupId>
279279
<artifactId>neo4j</artifactId>
280-
<version>1.14.3</version>
280+
<version>1.17.6</version>
281281
<scope>test</scope>
282282
</dependency>
283283
----

0 commit comments

Comments
 (0)