Commit 5506d972 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Fix and improve Neo4j related documentation"

Closes gh-14548
parent 8a53adf3
...@@ -4045,17 +4045,19 @@ the Mongo instance's configuration and logging routing. ...@@ -4045,17 +4045,19 @@ the Mongo instance's configuration and logging routing.
[[boot-features-neo4j]] [[boot-features-neo4j]]
=== Neo4j === Neo4j
http://neo4j.com/[Neo4j] is an open-source NoSQL graph database that uses a rich data http://neo4j.com/[Neo4j] is an open-source NoSQL graph database that uses a rich data
model of nodes connected by first class relationships, which is better suited for connected model of nodes connected by first class relationships, which is better suited for
big data than traditional RDBMS approaches. Spring Boot offers several conveniences for connected big data than traditional RDBMS approaches. Spring Boot offers several
working with Neo4j, including the `spring-boot-starter-data-neo4j` "`Starter`". conveniences for working with Neo4j, including the `spring-boot-starter-data-neo4j`
"`Starter`".
[[boot-features-connecting-to-neo4j]] [[boot-features-connecting-to-neo4j]]
==== Connecting to a Neo4j Database ==== Connecting to a Neo4j Database
To access a Neo4j server, you can inject an auto-configured `org.neo4j.ogm.session.Session`. To access a Neo4j server, you can inject an auto-configured
By default, the instance tries to connect to a Neo4j server at `localhost:7687` via the Bolt `org.neo4j.ogm.session.Session`. By default, the instance tries to connect to a Neo4j
protocol. The following example shows how to inject a Neo4j session: server at `localhost:7687` using the Bolt protocol. The following example shows how to
inject a Neo4j `Session`:
[source,java,indent=0] [source,java,indent=0]
---- ----
...@@ -4084,15 +4086,14 @@ properties, as shown in the following example: ...@@ -4084,15 +4086,14 @@ properties, as shown in the following example:
spring.data.neo4j.password=secret spring.data.neo4j.password=secret
---- ----
You can take full control over the session creation by adding a You can take full control over the session creation by adding a
`org.neo4j.ogm.config.Configuration` `@Bean`. To completely disable the auto-configuration `org.neo4j.ogm.config.Configuration` `@Bean`. Also, adding a `@Bean` of type
provided by the "`Starter`" , add a `@Bean` of type `org.neo4j.ogm.session.SessionFactory`. `SessionFactory` disables the auto-configuration and gives you full control.
[[boot-features-connecting-to-neo4j-embedded]] [[boot-features-connecting-to-neo4j-embedded]]
==== Using the Embedded Mode ==== Using the Embedded Mode
If you add `org.neo4j:neo4j-ogm-embedded-driver` to the dependencies of your application, If you add `org.neo4j:neo4j-ogm-embedded-driver` to the dependencies of your application,
Spring Boot automatically configures an in-process embedded instance of Neo4j that does Spring Boot automatically configures an in-process embedded instance of Neo4j that does
not persist any data when your application shuts down. not persist any data when your application shuts down.
...@@ -4102,7 +4103,7 @@ not persist any data when your application shuts down. ...@@ -4102,7 +4103,7 @@ not persist any data when your application shuts down.
As the embedded Neo4j OGM driver does not provide the Neo4j kernel itself, you have As the embedded Neo4j OGM driver does not provide the Neo4j kernel itself, you have
to declare `org.neo4j:neo4j` as dependency yourself. Refer to to declare `org.neo4j:neo4j` as dependency yourself. Refer to
https://neo4j.com/docs/ogm-manual/current/reference/#reference:getting-started[the https://neo4j.com/docs/ogm-manual/current/reference/#reference:getting-started[the
Neo4j OGM documentation] for list of compatible versions. Neo4j OGM documentation] for a list of compatible versions.
==== ====
The embedded driver takes precedence over the other drivers when there are multiple The embedded driver takes precedence over the other drivers when there are multiple
...@@ -4116,14 +4117,13 @@ kernel are on the classpath as described above. ...@@ -4116,14 +4117,13 @@ kernel are on the classpath as described above.
[NOTE] [NOTE]
==== ====
You can enable persistence for the embedded mode by providing a path to a database file You can enable persistence for the embedded mode by providing a path to a database file
in your configuration like this: `spring.data.neo4j.uri=file://var/tmp/graph.db`. in your configuration, e.g. `spring.data.neo4j.uri=file://var/tmp/graph.db`.
==== ====
[[boot-features-neo4j-ogm-session]] [[boot-features-neo4j-ogm-session]]
==== Neo4jSession ==== Neo4jSession
By default, if you are running a web application, the session is bound to the thread for By default, if you are running a web application, the session is bound to the thread for
the entire processing of the request (that is, it uses the "Open Session in View" the entire processing of the request (that is, it uses the "Open Session in View"
pattern). If you do not want this behavior, add the following line to your pattern). If you do not want this behavior, add the following line to your
...@@ -4166,8 +4166,8 @@ entities by using `@EnableNeo4jRepositories` and `@EntityScan` respectively on a ...@@ -4166,8 +4166,8 @@ entities by using `@EnableNeo4jRepositories` and `@EntityScan` respectively on a
`@Configuration`-bean. `@Configuration`-bean.
TIP: For complete details of Spring Data Neo4j, including its object mapping TIP: For complete details of Spring Data Neo4j, including its object mapping
technologies, refer to the https://projects.spring.io/spring-data-neo4j/[project page] and technologies, refer to the https://projects.spring.io/spring-data-neo4j/[reference
the reference documentation. documentation].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment