Skip to content

Commit 045d2f6

Browse files
committed
Document Spring Data Neo4j 6 support
Closes gh-22652
1 parent d4ba55f commit 045d2f6

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4527,9 +4527,10 @@ Each will be called in order with the `ConfigBuilder` that is used to build the
45274527
[[boot-features-spring-data-neo4j-repositories]]
45284528
==== Spring Data Neo4j Repositories
45294529
Spring Data includes repository support for Neo4j.
4530+
For complete details of Spring Data Neo4j, refer to the {spring-data-neo4j-docs}[reference documentation].
45304531

45314532
Spring Data Neo4j shares the common infrastructure with Spring Data JPA as many other Spring Data modules do.
4532-
You could take the JPA example from earlier and define `City` as Neo4j OGM `@NodeEntity` rather than JPA `@Entity` and the repository abstraction works in the same way, as shown in the following example:
4533+
You could take the JPA example from earlier and define `City` as Spring Data Neo4j `@Node` rather than JPA `@Entity` and the repository abstraction works in the same way, as shown in the following example:
45334534

45344535
[source,java,indent=0]
45354536
----
@@ -4547,9 +4548,10 @@ You could take the JPA example from earlier and define `City` as Neo4j OGM `@Nod
45474548
----
45484549

45494550
The `spring-boot-starter-data-neo4j` "`Starter`" enables the repository support as well as transaction management.
4550-
You can customize the locations to look for repositories and entities by using `@EnableNeo4jRepositories` and `@EntityScan` respectively on a `@Configuration`-bean.
4551+
Spring Boot supports both classic and reactive Neo4j repositories, using the `Neo4jTemplate` or `ReactiveNeo4jTemplate` beans.
4552+
When Project Reactor is available on the classpath, the reactive style is also auto-configured.
45514553

4552-
TIP: For complete details of Spring Data Neo4j, including its object mapping technologies, refer to the {spring-data-neo4j-docs}[reference documentation].
4554+
You can customize the locations to look for repositories and entities by using `@EnableNeo4jRepositories` and `@EntityScan` respectively on a `@Configuration`-bean.
45534555

45544556

45554557

@@ -7152,7 +7154,7 @@ If, however, you prefer to run tests against a real MongoDB server, you should e
71527154
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-neo4j-test]]
71537155
==== Auto-configured Data Neo4j Tests
71547156
You can use `@DataNeo4jTest` to test Neo4j applications.
7155-
By default, it uses an in-memory embedded Neo4j (if the embedded driver is available), scans for `@NodeEntity` classes, and configures Spring Data Neo4j repositories.
7157+
By default, it scans for `@Node` classes, and configures Spring Data Neo4j repositories.
71567158
Regular `@Component` beans are not loaded into the `ApplicationContext`.
71577159
(For more about using Neo4J with Spring Boot, see "<<boot-features-neo4j>>", earlier in this chapter.)
71587160

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,9 +44,8 @@
4444
* Using this annotation will disable full auto-configuration and instead apply only
4545
* configuration relevant to Neo4j tests.
4646
* <p>
47-
* By default, tests annotated with {@code @DataNeo4jTest} will use an embedded in-memory
48-
* Neo4j process (if available). They will also be transactional with the usual
49-
* test-related semantics (i.e. rollback by default).
47+
* By default, tests annotated with {@code @DataNeo4jTest} are transactional with the
48+
* usual test-related semantics (i.e. rollback by default).
5049
* <p>
5150
* When using JUnit 4, this annotation should be used in combination with
5251
* {@code @RunWith(SpringRunner.class)}.

0 commit comments

Comments
 (0)