diff --git a/Jenkinsfile b/Jenkinsfile
index 51cd8ecb2..291256d01 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -24,12 +24,15 @@ pipeline {
image 'adoptopenjdk/openjdk8:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
+ args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
}
}
options { timeout(time: 30, unit: 'MINUTES') }
steps {
- sh 'rm -rf ?'
+ sh 'mkdir -p /tmp/jenkins-home'
+ sh 'chown -R 1001:1001 .'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list verify -Dsort -U -B'
+ sh 'chown -R 1001:1001 .'
}
}
@@ -47,12 +50,15 @@ pipeline {
image 'adoptopenjdk/openjdk11:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
+ args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
}
}
options { timeout(time: 30, unit: 'MINUTES') }
steps {
- sh 'rm -rf ?'
+ sh 'mkdir -p /tmp/jenkins-home'
+ sh 'chown -R 1001:1001 .'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pjava11 clean dependency:list verify -Dsort -U -B'
+ sh 'chown -R 1001:1001 .'
}
}
@@ -62,12 +68,15 @@ pipeline {
image 'adoptopenjdk/openjdk14:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
+ args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
}
}
options { timeout(time: 30, unit: 'MINUTES') }
steps {
- sh 'rm -rf ?'
+ sh 'mkdir -p /tmp/jenkins-home'
+ sh 'chown -R 1001:1001 .'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pjava11 clean dependency:list verify -Dsort -U -B'
+ sh 'chown -R 1001:1001 .'
}
}
}
@@ -84,7 +93,7 @@ pipeline {
docker {
image 'adoptopenjdk/openjdk8:latest'
label 'data'
- args '-v $HOME:/tmp/jenkins-home'
+ args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
}
}
options { timeout(time: 20, unit: 'MINUTES') }
@@ -94,8 +103,9 @@ pipeline {
}
steps {
- sh 'rm -rf ?'
+ sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
+ '-Drunning-on-ci ' +
'-Dartifactory.server=https://repo.spring.io ' +
"-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
diff --git a/README.adoc b/README.adoc
index 31f62d722..ccf0ccedb 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1,27 +1,35 @@
-= Spring Data Neo4j⚡️RX
+image:https://spring.io/badges/spring-data-neo4j/ga.svg[Spring Data Neo4j,link=https://projects.spring.io/spring-data-neo4j#quick-start] image:https://spring.io/badges/spring-data-neo4j/snapshot.svg[Spring Data Neo4j,link=https://projects.spring.io/spring-data-neo4j#quick-start]
+
+= Spring Data Neo4j image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-neo4j%2Fmaster&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-neo4j/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]]
:sectanchors:
// tag::properties[]
-:groupId: org.neo4j.springframework.data
-:artifactId: spring-data-neo4j-rx
+:neo4jGroupId: org.neo4j.springframework.data
+:springGroupId: org.springframework.data.neo4j
+:artifactId: spring-data-neo4j
:artifactIdStarter: spring-data-neo4j-rx-spring-boot-starter
:neo4j-version: 4.0.4
:spring-boot-version: 2.3.0.RELEASE
:spring-data-neo4j-rx-version: 1.1.1
+:spring-data-neo4j-version: 6.0.0
// end::properties[]
-image:https://img.shields.io/maven-central/v/org.neo4j.springframework.data/spring-data-neo4j-rx.svg[Maven Central,link=http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.neo4j.springframework.data%22%20AND%20a%3A%22spring-data-neo4j-rx%22]
-
[abstract]
--
-Spring Data Neo4j⚡️RX - or in short _SDN/RX_ - is an ongoing effort to create the next generation of Spring Data Neo4j, with full reactive support and lightweight mapping.
-SDN/RX will work with immutable entities, regardless whether written in Java or Kotlin.
+Spring Data Neo4j - or in short _SDN_ - is an ongoing effort to create the next generation of Spring Data Neo4j, with full reactive support and lightweight mapping.
+SDN will work with immutable entities, regardless whether written in Java or Kotlin.
--
The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.
-The SDN/RX project aims to provide a familiar and consistent Spring-based programming model for integrating with the https://neo4j.com/[Neo4j] Graph Database.
+The SDN project aims to provide a familiar and consistent Spring-based programming model for integrating with the https://neo4j.com/[Neo4j] Graph Database.
+
+== Code of Conduct
+
+This project is governed by the link:https://github.com/spring-projects/.github/blob/master/CODE_OF_CONDUCT.md[Spring Code of Conduct].
+By participating, you are expected to uphold this code of conduct.
+Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
== Manual
@@ -30,6 +38,75 @@ https://neo4j.github.io/sdn-rx[Manual].
== Getting Started
+=== Maven configuration
+
+==== With Spring Boot
+
+If you are on https://spring.io/projects/spring-boot[Spring Boot], all you have to do is to add our starter:
+
+[source,xml,subs="verbatim,attributes"]
+----
+
+ {neo4jgroupId}
+ {artifactIdStarter}
+ {spring-data-neo4j-rx-version}
+
+----
+
+and configure your database connection:
+
+[source,properties]
+----
+org.neo4j.driver.uri=bolt://localhost:7687
+org.neo4j.driver.authentication.username=neo4j
+org.neo4j.driver.authentication.password=secret
+----
+
+Please have a look at our https://neo4j.github.io/sdn-rx[manual] for an overview about the architecture, how to define
+mappings and more.
+
+==== Without Spring Boot
+
+If you are using a plain Spring Framework project without Spring Boot, please add this Maven dependency:
+
+[source,xml,subs="verbatim,attributes"]
+----
+
+ {springGroupId}
+ {artifactId}
+ {spring-data-neo4j-version}
+
+----
+
+and configure SDN for reactive database access like this:
+
+[source,java]
+----
+@Configuration
+@EnableReactiveNeo4jRepositories
+@EnableTransactionManagement
+class MyConfiguration extends AbstractReactiveNeo4jConfig {
+
+ @Bean
+ public Driver driver() {
+ return GraphDatabase.driver("bolt://localhost:7687", AuthTokens.basic("neo4j", "secret"));
+ }
+
+ @Override
+ protected Collection getMappingBasePackages() {
+ return Collections.singletonList(Person.class.getPackage().getName());
+ }
+}
+----
+
+The imperative version looks pretty much the same but uses `EnableNeo4jRepositories` and `AbstractNeo4jConfig`.
+
+IMPORTANT: We recommend Spring Boot, the automatic configuration and especially the dependency management
+through the Starters in contrast to the manual work of managing dependencies and configuration.
++
+Please consult our https://neo4j.github.io/sdn-rx[manual] for more information.
+
+
Here is a quick teaser of a reactive application using Spring Data Repositories in Java:
[source,java]
@@ -71,77 +148,33 @@ class MyService {
}
----
-TIP: SDN/RX is not only about reactive support, all features are available in both ways: Imperative and reactive, we
- only prefer to showcase the new reactive database access support here.
+=== Building SDN
-=== Maven configuration
+Please have a look at the documentation: https://neo4j.github.io/sdn-rx/current/#building-sdn-rx[Building SDN].
-==== With Spring Boot
+== Getting Help
-If you are on https://spring.io/projects/spring-boot[Spring Boot], all you have to do is to add our starter:
+Having trouble with Spring Data? We’d love to help!
-[source,xml,subs="verbatim,attributes"]
-----
-
- {groupId}
- {artifactIdStarter}
- {spring-data-neo4j-rx-version}
-
-----
+* Check the
+https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/[reference documentation], and https://docs.spring.io/spring-data/neo4j/docs/current/api/[Javadocs].
+* Learn the Spring basics – Spring Data builds on Spring Framework, check the https://spring.io[spring.io] web-site for a wealth of reference documentation.
+If you are just starting out with Spring, try one of the https://spring.io/guides[guides].
+* If you are upgrading, check out the https://docs.spring.io/spring-data/neo4j/docs/current/changelog.txt[changelog] for "`new and noteworthy`" features.
+* Ask a question - we monitor https://stackoverflow.com[stackoverflow.com] for questions tagged with https://stackoverflow.com/questions/tagged/spring-data-neo4j[spring-data-neo4j].
+* Report bugs with Spring Data Neo4j at https://jira.spring.io/browse/DATAGRAPH[jira.spring.io/browse/DATAGRAPH].
-and configure your database connection:
+== Reporting Issues
-[source,properties]
-----
-org.neo4j.driver.uri=bolt://localhost:7687
-org.neo4j.driver.authentication.username=neo4j
-org.neo4j.driver.authentication.password=secret
-----
+Spring Data uses JIRA as issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:
-Please have a look at our https://neo4j.github.io/sdn-rx[manual] for an overview about the architecture, how to define
-mappings and more.
+* Before you log a bug, please search the
+https://jira.spring.io/browse/DATAGRAPH[issue tracker] to see if someone has already reported the problem.
+* If the issue doesn’t already exist, https://jira.spring.io/browse/DATAGRAPH[create a new issue].
+* Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using and JVM version.
+* If you need to paste code, or include a stack trace use JIRA `{code}…{code}` escapes before and after your text.
+* If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code.
-==== Without Spring Boot
+== License
-If you are using a plain Spring Framework project without Spring Boot, please add this Maven dependency:
-
-[source,xml,subs="verbatim,attributes"]
-----
-
- {groupId}
- {artifactId}
- {spring-data-neo4j-rx-version}
-
-----
-
-and configure SDN/RX for reactive database access like this:
-
-[source,java]
-----
-@Configuration
-@EnableReactiveNeo4jRepositories
-@EnableTransactionManagement
-class MyConfiguration extends AbstractReactiveNeo4jConfig {
-
- @Bean
- public Driver driver() {
- return GraphDatabase.driver("bolt://localhost:7687", AuthTokens.basic("neo4j", "secret"));
- }
-
- @Override
- protected Collection getMappingBasePackages() {
- return Collections.singletonList(Person.class.getPackage().getName());
- }
-}
-----
-
-The imperative version looks pretty much the same but uses `EnableNeo4jRepositories` and `AbstractNeo4jConfig`.
-
-IMPORTANT: We recommend Spring Boot, the automatic configuration and especially the dependency management
- through the Starters in contrast to the manual work of managing dependencies and configuration.
- +
- Please consult our https://neo4j.github.io/sdn-rx[manual] for more information.
-
-=== Building SDN/RX
-
-Please have a look at the documentation: https://neo4j.github.io/sdn-rx/current/#building-sdn-rx[Building SDN/RX].
+Spring Data Neo4j is Open Source software released under the https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].
diff --git a/checkstyle/config.xml b/checkstyle/config.xml
deleted file mode 100644
index 85a1cdc65..000000000
--- a/checkstyle/config.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/checkstyle/java-header.txt b/checkstyle/java-header.txt
deleted file mode 100644
index 0fee0dc1f..000000000
--- a/checkstyle/java-header.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-^\Q/*\E$
-^\Q * Copyright 2011-2020 the original author or authors.\E$
-^\Q *\E$
-^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$
-^\Q * you may not use this file except in compliance with the License.\E$
-^\Q * You may obtain a copy of the License at\E$
-^\Q *\E$
-^\Q * https://www.apache.org/licenses/LICENSE-2.0\E$
-^\Q *\E$
-^\Q * Unless required by applicable law or agreed to in writing, software\E$
-^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$
-^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$
-^\Q * See the License for the specific language governing permissions and\E$
-^\Q * limitations under the License.\E$
-^\Q */\E$
-^\Qpackage\E .+;$
-^.*$
diff --git a/checkstyle/suppressions.xml b/checkstyle/suppressions.xml
deleted file mode 100644
index 59845ab3b..000000000
--- a/checkstyle/suppressions.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/etc/checkstyle/java-header.txt b/etc/checkstyle/java-header.txt
index 8569a36d2..7be21cfed 100644
--- a/etc/checkstyle/java-header.txt
+++ b/etc/checkstyle/java-header.txt
@@ -1,14 +1,11 @@
^\Q/*\E$
-^\Q * Copyright (c) 2019-2020 "Neo4j,"\E$
-^\Q * Neo4j Sweden AB [https://neo4j.com]\E$
-^\Q *\E$
-^\Q * This file is part of Neo4j.\E$
+^\Q * Copyright 2011-20\E\d\d\Q the original author or authors.\E$
^\Q *\E$
^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$
^\Q * you may not use this file except in compliance with the License.\E$
^\Q * You may obtain a copy of the License at\E$
^\Q *\E$
-^\Q * https://www.apache.org/licenses/LICENSE-2.0\E$
+^\Q * https://www.apache.org/licenses/LICENSE-2.0\E$
^\Q *\E$
^\Q * Unless required by applicable law or agreed to in writing, software\E$
^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$
diff --git a/etc/checkstyle/suppressions.xml b/etc/checkstyle/suppressions.xml
index 829c1a269..d244e919b 100644
--- a/etc/checkstyle/suppressions.xml
+++ b/etc/checkstyle/suppressions.xml
@@ -1,7 +1,7 @@
+ "https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
diff --git a/etc/jqassistant/naming.adoc b/etc/jqassistant/naming.adoc
index debb0f602..b8b760c84 100644
--- a/etc/jqassistant/naming.adoc
+++ b/etc/jqassistant/naming.adoc
@@ -5,12 +5,12 @@ The following naming conventions are used throughout the project:
[[naming:TypeNameMustBeginWithGroupId]]
[source,cypher,role=constraint]
-.All Java types must be located in packages that start with `org.neo4j.springframework.data`.
+.All Java types must be located in packages that start with `org.springframework.data.neo4j`.
----
MATCH
(project:Maven:Project)-[:CREATES]->(:Artifact)-[:CONTAINS]->(type:Type)
WHERE
- NOT type.fqn starts with 'org.neo4j.springframework.data'
+ NOT type.fqn starts with 'org.springframework.data.neo4j'
RETURN
project as Project, collect(type) as TypeWithWrongName
----
diff --git a/etc/jqassistant/structure.adoc b/etc/jqassistant/structure.adoc
index 871b61d85..46e968034 100644
--- a/etc/jqassistant/structure.adoc
+++ b/etc/jqassistant/structure.adoc
@@ -8,10 +8,10 @@ Most of the time, the package structure under `org.neo4j.springframework.data` s
.The mapping package must not depend on any other SDN/RX packages than `schema` and `convert`
----
MATCH (a:Main:Artifact)
-OPTIONAL MATCH (a) -[:CONTAINS]-> (s:Package) WHERE s.fqn in ['org.neo4j.springframework.data.core.schema', 'org.neo4j.springframework.data.core.convert']
+OPTIONAL MATCH (a) -[:CONTAINS]-> (s:Package) WHERE s.fqn in ['org.springframework.data.neo4j.core.schema', 'org.springframework.data.neo4j.core.convert']
WITH collect(s) as allowed, a
MATCH (a) -[:CONTAINS]-> (p1:Package) -[:DEPENDS_ON]-> (p2:Package) <-[:CONTAINS]- (a)
-WHERE p1.fqn = 'org.neo4j.springframework.data.core.mapping'
+WHERE p1.fqn = 'org.springframework.data.neo4j.core.mapping'
AND NOT (p2 in allowed OR (p1) -[:CONTAINS]-> (p2))
return p1,p2
----
diff --git a/pom.xml b/pom.xml
index 66c2f92ab..fcdbd0d8c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,10 +1,7 @@
-
+4.0.0org.springframework.data.buildspring-data-parent
- 2.3.1.RELEASE
+ 2.4.0-SNAPSHOT
- org.neo4j.springframework.data
- spring-data-neo4j-rx-parent
- ${revision}${sha1}${changelist}
- pom
+ org.springframework.data
+ spring-data-neo4j
+ 6.0.0-SNAPSHOT
- Spring Data Neo4j RX
+ Spring Data Neo4jNext generation Object-Graph-Mapping for Spring Data.
+ https://projects.spring.io/spring-data-neo4j2019Neo4j, Neo4j Sweden AB
@@ -52,7 +49,7 @@
Gerrit Meiergerrit.meier at neo4j.comNeo Technology
- http://www.neotechnology.com
+ https://www.neotechnology.comProject Lead
@@ -63,7 +60,7 @@
Michael Simonsmichael.simons at neo4j.comNeo Technology
- http://www.neotechnology.com
+ https://www.neotechnology.comProject Lead
@@ -71,19 +68,9 @@
-
- spring-data-neo4j-rx
- spring-data-neo4j-rx-spring-boot-starter-parent
- examples/reactive-web
- examples/imperative-web
- examples/mapping
- examples/multi-database
- examples/rest
- examples/docs
- examples/kotlin
-
-
+ ja
+
1.1.02.0.11.6.0
@@ -92,13 +79,17 @@
-SNAPSHOT8.292020.0.0
+ spring-data-neo4j
+ SDNEO4J1.2.10.8.51.8
-
+ spring.data.neo4j
+ 2.3.11.8.01.8.01.8.0
+ 4.0.2.25.6.13.1.03.0.0-M1
@@ -118,13 +109,12 @@
3.0.1${project.build.directory}/docsUTF-8
- Arabba-RELEASE
+ Arabba-SR51.2.11.11.3.82.2.5
-
- 2.3.1.RELEASE
+ 2.4.0-SNAPSHOT1.13.0${skipTests}
@@ -153,6 +143,12 @@
objenesis${objenesis.version}
+
+ javax.xml.bind
+ jaxb-api
+ ${jaxb.version}
+ provided
+ io.reactivexrxjava
@@ -253,9 +249,162 @@
${testcontainers.version}test
+
+ eu.michael-simons.neo4j
+ junit-jupiter-causal-cluster-testcontainer-extension
+ ${junit-cc-testcontainer}
+ test
+
+
+
+ io.projectreactor
+ reactor-core
+ true
+
+
+ io.projectreactor
+ reactor-test
+ test
+ true
+
+
+ io.reactivex
+ rxjava
+ true
+
+
+ io.reactivex
+ rxjava-reactive-streams
+ true
+
+
+ io.reactivex.rxjava2
+ rxjava
+ true
+
+
+ javax.transaction
+ jta
+ 1.1
+ test
+
+
+ org.springframework.data
+ spring-data-r2dbc
+ 1.0.0.RELEASE
+ test
+
+
+ io.r2dbc
+ r2dbc-h2
+ test
+
+
+ org.neo4j
+ neo4j-cypher-dsl
+
+
+ org.apiguardian
+ apiguardian-api
+
+
+ org.assertj
+ assertj-core
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter
+ test
+
+
+ org.mockito
+ mockito-core
+ test
+
+
+ org.mockito
+ mockito-junit-jupiter
+ test
+
+
+ org.neo4j.driver
+ neo4j-java-driver
+
+
+ org.springframework
+ spring-beans
+
+
+ org.springframework
+ spring-context
+
+
+ org.springframework
+ spring-core
+
+
+ org.springframework
+ spring-tx
+
+
+ org.springframework.data
+ spring-data-commons
+
+
+ org.jetbrains.kotlin
+ kotlin-stdlib-jdk8
+ true
+
+
+ org.jetbrains.kotlin
+ kotlin-reflect
+ true
+
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-core
+ true
+
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-reactor
+ true
+
+
+ io.mockk
+ mockk
+ ${mockk}
+ test
+
+
+ org.testcontainers
+ junit-jupiter
+ test
+
+
+ org.testcontainers
+ neo4j
+ test
+
+
+ eu.michael-simons.neo4j
+ junit-jupiter-causal-cluster-testcontainer-extension
+ test
+
+
+
+ org.projectlombok
+ lombok
+ ${lombok}
+ true
+ test
+
+
+
@@ -280,26 +429,6 @@
false
-
- maven-checkstyle-plugin
- ${maven-checkstyle-plugin.version}
-
-
- com.puppycrawl.tools
- checkstyle
- ${checkstyle.version}
-
-
-
- etc/checkstyle/config.xml
- etc/checkstyle/suppressions.xml
- etc/checkstyle/java-header.txt
- ${project.build.sourceEncoding}
- true
- true
- true
-
- com.buschmais.jqassistantjqassistant-maven-plugin
@@ -341,11 +470,6 @@
maven-install-plugin${maven-install-plugin.version}
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${maven-surefire-plugin.version}
- org.apache.maven.pluginsmaven-failsafe-plugin
@@ -377,16 +501,8 @@
- maven-checkstyle-plugin
-
-
- validate
- validate
-
- check
-
-
-
+ org.apache.maven.plugins
+ maven-assembly-pluginorg.jacoco
@@ -411,6 +527,12 @@
${project.build.directory}/jacoco.exec
+
+ report
+
+ report
+
+
@@ -541,6 +663,101 @@
+
+ com.buschmais.jqassistant
+ jqassistant-maven-plugin
+
+
+ jqassistant-scan
+ verify
+
+ scan
+
+
+
+ jacoco.xml
+
+
+
+ ${project.basedir}/.git
+
+
+ ${project.reporting.outputDirectory}/jacoco
+
+
+
+
+
+ jqassistant-analyze
+
+ analyze
+
+
+ MINOR
+
+ default
+ jqassistant-dashboard:Default
+
+
+
+
+
+
+
+
+
+ spring-libs-snapshot
+ https://repo.spring.io/libs-snapshot
+
+
+
+
+
+ spring-plugins-release
+ https://repo.spring.io/plugins-release
+
+
+ spring-libs-milestone
+ https://repo.spring.io/libs-milestone
+
+
+
+
+
+ always-but-ci
+
+
+ !running-on-ci
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+
+
+ validate
+ validate
+
+ check
+
+
+
+
+ ${project.basedir}/etc/checkstyle/config.xml
+ ${project.basedir}/etc/checkstyle/suppressions.xml
+ ${project.basedir}/etc/checkstyle/java-header.txt
+ ${project.build.sourceEncoding}
+ true
+ true
+ true
+
+
+
+
+
+
diff --git a/spring-data-neo4j-distribution/pom.xml b/spring-data-neo4j-distribution/pom.xml
deleted file mode 100644
index c1c651182..000000000
--- a/spring-data-neo4j-distribution/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
- 4.0.0
-
- spring-data-neo4j-distribution
-
- pom
-
- Spring Data Neo4j - Distribution
- Distribution build for Spring Data Neo4j
-
-
- org.springframework.data
- spring-data-neo4j-parent
- 5.4.0-SNAPSHOT
- ../pom.xml
-
-
-
- ${basedir}/..
- spring-data-neo4j
- SDNEO4J
-
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- org.codehaus.mojo
- wagon-maven-plugin
-
-
- org.asciidoctor
- asciidoctor-maven-plugin
-
-
-
-
-
-
diff --git a/spring-data-neo4j/pom.xml b/spring-data-neo4j/pom.xml
deleted file mode 100644
index 821a67158..000000000
--- a/spring-data-neo4j/pom.xml
+++ /dev/null
@@ -1,258 +0,0 @@
-
-
-
- 4.0.0
-
-
- spring-data-neo4j-rx-parent
- org.neo4j.springframework.data
- ${revision}${sha1}${changelist}
-
-
- spring-data-neo4j-rx
-
- SDN⚡️RX
- Core module of SDN.rx.
-
-
- spring.data.neo4j.rx
-
-
-
-
- io.projectreactor
- reactor-core
- true
-
-
- io.projectreactor
- reactor-test
- test
- true
-
-
- io.reactivex
- rxjava
- true
-
-
- io.reactivex
- rxjava-reactive-streams
- true
-
-
- io.reactivex.rxjava2
- rxjava
- true
-
-
- javax.transaction
- jta
- 1.1
- test
-
-
- org.springframework.data
- spring-data-r2dbc
- 1.0.0.RELEASE
- test
-
-
- io.r2dbc
- r2dbc-h2
- test
-
-
- org.neo4j
- neo4j-cypher-dsl
-
-
- org.apiguardian
- apiguardian-api
-
-
- org.assertj
- assertj-core
- test
-
-
- org.junit.jupiter
- junit-jupiter
- test
-
-
- org.mockito
- mockito-core
- test
-
-
- org.mockito
- mockito-junit-jupiter
- test
-
-
- org.neo4j.driver
- neo4j-java-driver
-
-
- org.springframework
- spring-beans
-
-
- org.springframework
- spring-context
-
-
- org.springframework
- spring-core
-
-
- org.springframework
- spring-tx
-
-
- org.springframework.data
- spring-data-commons
-
-
- org.jetbrains.kotlin
- kotlin-stdlib-jdk8
- true
-
-
- org.jetbrains.kotlin
- kotlin-reflect
- true
-
-
- org.jetbrains.kotlinx
- kotlinx-coroutines-core
- true
-
-
- org.jetbrains.kotlinx
- kotlinx-coroutines-reactor
- true
-
-
- io.mockk
- mockk
- ${mockk}
- test
-
-
- org.testcontainers
- junit-jupiter
- test
-
-
- org.testcontainers
- neo4j
- test
-
-
- eu.michael-simons.neo4j
- junit-jupiter-causal-cluster-testcontainer-extension
- 4.0.2.2
- test
-
-
-
- org.projectlombok
- lombok
- ${lombok}
- true
- test
-
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
-
-
- report
-
- report
-
-
-
-
-
- com.buschmais.jqassistant
- jqassistant-maven-plugin
-
-
- jqassistant-scan
- verify
-
- scan
-
-
-
- jacoco.xml
-
-
-
- ${project.basedir}/../.git
-
-
- ${project.reporting.outputDirectory}/jacoco
-
-
-
-
-
- jqassistant-analyze
-
- analyze
-
-
- MINOR
-
- default
- jqassistant-dashboard:Default
-
-
-
-
-
-
-
-
-
-
-
- com.buschmais.jqassistant
- jqassistant-maven-plugin
- ${jqassistant.version}
-
-
-
- report
-
-
-
-
-
-
-
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/Depth.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/Depth.java
deleted file mode 100644
index 9d002c338..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/Depth.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.springframework.data.annotation.QueryAnnotation;
-
-/**
- * Specifies the depth of the query. Used with derived finders.
- *
- * @author Luanne Misquitta
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.PARAMETER, ElementType.METHOD })
-@QueryAnnotation
-@Documented
-public @interface Depth {
-
- int value() default 1;
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/EnableBookmarkManagement.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/EnableBookmarkManagement.java
deleted file mode 100644
index 10a033dbd..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/EnableBookmarkManagement.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.springframework.context.annotation.Import;
-import org.springframework.data.neo4j.bookmark.BookmarkManagementConfiguration;
-
-/**
- * Enables bookmark management
- *
- * Bean implementing {@link org.springframework.data.neo4j.bookmark.BookmarkManager} interface needs to exist in the
- * context. Default implementation {@link org.springframework.data.neo4j.bookmark.CaffeineBookmarkManager} exists. Use
- * scope of the bean to control how bookmarks are managed. singleton - suitable for application wide bookmarks, e.g. fat
- * clients request,session - suitable for web applications
- *
- * NOTE: Only usable with OGM Bolt driver.
- *
- * @author Frantisek Hartman
- * @see UseBookmark
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = ElementType.TYPE)
-@Documented
-@Import(BookmarkManagementConfiguration.class)
-public @interface EnableBookmarkManagement {
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/EnableNeo4jAuditing.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/EnableNeo4jAuditing.java
deleted file mode 100644
index 05b3f804c..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/EnableNeo4jAuditing.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.springframework.context.annotation.Import;
-import org.springframework.data.auditing.DateTimeProvider;
-import org.springframework.data.domain.AuditorAware;
-import org.springframework.data.neo4j.repository.config.Neo4jAuditingRegistrar;
-
-/**
- * Annotation to enable auditing in Neo4j via annotation configuration.
- *
- * @author Frantisek Hartman
- * @author Michael J. Simons
- */
-@Inherited
-@Documented
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-@Import(Neo4jAuditingRegistrar.class)
-public @interface EnableNeo4jAuditing {
-
- /**
- * Configures the {@link AuditorAware} bean to be used to lookup the current principal.
- *
- * @return
- */
- String auditorAwareRef() default "";
-
- /**
- * Configures whether the creation and modification dates are set. Defaults to {@literal true}.
- *
- * @return
- */
- boolean setDates() default true;
-
- /**
- * Configures whether the entity shall be marked as modified on creation. Defaults to {@literal true}.
- *
- * @return
- */
- boolean modifyOnCreate() default true;
-
- /**
- * Configures a {@link DateTimeProvider} bean name that allows customizing the {@link org.joda.time.DateTime} to be
- * used for setting creation and modification dates.
- *
- * @return
- */
- String dateTimeProviderRef() default "";
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/ExistsQuery.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/ExistsQuery.java
deleted file mode 100644
index f771e5087..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/ExistsQuery.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.springframework.core.annotation.AliasFor;
-
-/**
- * Annotation to declare a {@link Query} with a value containing an exists custom query. The result will then be used for
- * boolean projection.
- *
- * @author Gerrit Meier
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
-@Documented
-@Query(exists = true)
-public @interface ExistsQuery {
-
- /**
- * The cypher query.
- *
- * @see Query#value()
- * @since 5.2
- */
- @AliasFor(annotation = Query.class)
- String value() default "";
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/Query.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/Query.java
deleted file mode 100644
index 6172de67d..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/Query.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.springframework.data.annotation.QueryAnnotation;
-
-/**
- * Annotation to declare finder queries directly on repository methods.
- *
- * @author Mark Angrish
- * @author Luanne Misquitta
- * @author Gerrit Meier
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD })
-@QueryAnnotation
-@Documented
-public @interface Query {
-
- /**
- * Defines the Cypher query to be executed when the annotated method is called.
- */
- String value() default "";
-
- /**
- * @return simpler count-query to be executed for @{see Pageable}-support
- */
- String countQuery() default "";
-
- /**
- * Returns whether the defined query should be executed as an exists projection.
- *
- * @since 5.2
- */
- boolean exists() default false;
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/QueryResult.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/QueryResult.java
deleted file mode 100644
index 4d2d0ed00..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/QueryResult.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation to be applied to interfaces and classes onto which arbitrary Cypher query results are to be mapped.
- *
- * @author Adam George
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-@Documented
-public @interface QueryResult {
-
- // no annotation properties needed
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/UseBookmark.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/UseBookmark.java
deleted file mode 100644
index a1bd4caa7..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/UseBookmark.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that a transactional operation will use bookmarks that are currently stored in BookmarkManager when
- * creating Neo4j session. Must be used on a method with @Transactional annotation. May be used on class - applies to
- * all methods or on specific methods.
- *
- *
- * @author Frantisek Hartman
- * @see EnableBookmarkManagement
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE, ElementType.METHOD })
-@Documented
-public @interface UseBookmark {
-
- /**
- * If the annotated method should set bookmark
- */
- boolean value() default true;
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/package-info.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/package-info.java
deleted file mode 100644
index 58df67027..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/annotation/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * A set of Neo4j specific annotations (especially Depth and Bookmark support).
- */
-package org.springframework.data.neo4j.annotation;
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BeanFactoryBookmarkOperationAdvisor.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BeanFactoryBookmarkOperationAdvisor.java
deleted file mode 100644
index e7d21d357..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BeanFactoryBookmarkOperationAdvisor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.bookmark;
-
-import org.springframework.aop.Pointcut;
-import org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor;
-
-/**
- * Advisor for BookmarkManagement
- *
- * Used to setup BookmarkInfo for methods marked with @{@link org.springframework.data.neo4j.annotation.UseBookmark}
- *
- * @author Frantisek Hartman
- * @author Michael J. Simons
- */
-public class BeanFactoryBookmarkOperationAdvisor extends AbstractBeanFactoryPointcutAdvisor {
-
- @Override
- public Pointcut getPointcut() {
- return new BookmarkOperationPointcut();
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkInfo.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkInfo.java
deleted file mode 100644
index 72b46477f..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkInfo.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.bookmark;
-
-import java.io.Serializable;
-import java.util.Collection;
-
-/**
- * Bookmark info stored as thread local
- *
- * @author Frantisek Hartman
- */
-public class BookmarkInfo implements Serializable {
-
- private boolean useBookmark;
- private Collection bookmarks;
-
- public BookmarkInfo() {}
-
- public BookmarkInfo(boolean useBookmark) {
- this.useBookmark = true;
- }
-
- public boolean shouldUseBookmark() {
- return useBookmark;
- }
-
- public void setUseBookmark(boolean useBookmark) {
- this.useBookmark = useBookmark;
- }
-
- public Collection getBookmarks() {
- return bookmarks;
- }
-
- public void setBookmarks(Collection bookmarks) {
- this.bookmarks = bookmarks;
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkInterceptor.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkInterceptor.java
deleted file mode 100644
index c5bd38ead..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkInterceptor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.bookmark;
-
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
-
-/**
- * Interceptor that sets {@link BookmarkInfo} as a ThreadLocal
- *
- * @author Frantisek Hartman
- */
-public class BookmarkInterceptor extends BookmarkSupport implements MethodInterceptor {
-
- @Override
- public Object invoke(MethodInvocation invocation) throws Throwable {
- BookmarkInfo previousValue;
-
- if (bookmarkInfoHolder.get() == null) {
- previousValue = null;
- } else {
- previousValue = bookmarkInfoHolder.get();
- }
- bookmarkInfoHolder.set(new BookmarkInfo(true));
-
- try {
- return invocation.proceed();
- } finally {
- bookmarkInfoHolder.set(previousValue);
- }
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkManagementConfiguration.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkManagementConfiguration.java
deleted file mode 100644
index da3e19c09..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkManagementConfiguration.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.bookmark;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Role;
-
-/**
- * Configuration used by @{@link org.springframework.data.neo4j.annotation.EnableBookmarkManagement}
- *
- * Note on bookmark management implementation: The implementation closely follows implementation
- * of @EnableTransactionManagement or @EnableCaching, with simplified pointcut.
- *
- * The bookmark interceptor will set BookmarkInfo thread local when a methods is annotated with @UseBookmark. It is
- * executed before transactional advice (see setOrder(0) ). Neo4j transaction manager then uses {@link BookmarkManager}
- * bean to retrieve currently stored bookmarks and begins new transaction using these bookmarks. After commit new
- * bookmark is stored in the BookmarkManager, replacing the bookmarks used to begin the transaction. The user needs to
- * provide the BookmarkManager bean.
- *
- * @author Frantisek Hartman
- */
-@Configuration
-public class BookmarkManagementConfiguration {
-
- @Bean
- @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
- public BeanFactoryBookmarkOperationAdvisor bookmarkAdvisor() {
- BeanFactoryBookmarkOperationAdvisor advisor = new BeanFactoryBookmarkOperationAdvisor();
- advisor.setAdvice(bookmarkInterceptor());
- advisor.setOrder(0);
- return advisor;
- }
-
- @Bean
- @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
- public BookmarkInterceptor bookmarkInterceptor() {
- return new BookmarkInterceptor();
- }
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkManager.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkManager.java
deleted file mode 100644
index ebf459ec9..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkManager.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.bookmark;
-
-import java.util.Collection;
-
-/**
- * Bookmark manager keeps track of Neo4j transaction bookmarks
- *
- * @author Frantisek Hartman
- * @see org.springframework.data.neo4j.annotation.EnableBookmarkManagement
- */
-public interface BookmarkManager {
-
- /**
- * Return stored bookmarks
- *
- * @return bookmarks
- */
- Collection getBookmarks();
-
- /**
- * Stores bookmark to this manager
- *
- * @param bookmark new bookmark to store
- * @param previous previous bookmarks that are to be replaced by new bookmark, may be empty
- */
- void storeBookmark(String bookmark, Collection previous);
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkOperationPointcut.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkOperationPointcut.java
deleted file mode 100644
index 0d49c9678..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkOperationPointcut.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.bookmark;
-
-import java.lang.reflect.Method;
-
-import org.springframework.aop.support.StaticMethodMatcherPointcut;
-import org.springframework.core.annotation.AnnotatedElementUtils;
-import org.springframework.core.annotation.AnnotationUtils;
-import org.springframework.data.neo4j.annotation.UseBookmark;
-
-/**
- * Pointcut for methods marked with @{@link UseBookmark}
- *
- * @author Frantisek Hartman
- */
-public class BookmarkOperationPointcut extends StaticMethodMatcherPointcut {
-
- @Override
- public boolean matches(Method method, Class> targetClass) {
- UseBookmark classAnnotation = AnnotatedElementUtils.findMergedAnnotation(targetClass, UseBookmark.class);
- UseBookmark methodAnnotation = AnnotatedElementUtils.findMergedAnnotation(method, UseBookmark.class);
-
- // method matches if @UseBookmark is on class, is true and not on method or
- // @UseBookmark is on method and is true
- // it is needed to cover @UseBookmark on class and @UseBookmark(false) on method
- return ((classAnnotation != null) && classAnnotation.value() && methodAnnotation == null)
- || ((methodAnnotation != null) && methodAnnotation.value());
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkSupport.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkSupport.java
deleted file mode 100644
index d6a647768..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/BookmarkSupport.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.bookmark;
-
-import org.springframework.core.NamedThreadLocal;
-
-/**
- * Helper class to access BookmarkInfo thread local
- *
- * @author Frantisek Hartman
- */
-public class BookmarkSupport {
-
- protected static final ThreadLocal bookmarkInfoHolder = new NamedThreadLocal<>("Bookmark info");
-
- public static BookmarkInfo currentBookmarkInfo() {
- return bookmarkInfoHolder.get();
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/CaffeineBookmarkManager.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/CaffeineBookmarkManager.java
deleted file mode 100644
index 3f8b974d6..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/CaffeineBookmarkManager.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.bookmark;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.concurrent.TimeUnit;
-
-import com.github.benmanes.caffeine.cache.Cache;
-import com.github.benmanes.caffeine.cache.Caffeine;
-
-/**
- * Implementation of the bookmark manager using Caffeine cache
- *
- * When using this class you must ensure that caffeine dependency is on your class path.
- *
- * @author Frantisek Hartman
- */
-public class CaffeineBookmarkManager implements BookmarkManager {
-
- private final Cache cache;
-
- public CaffeineBookmarkManager() {
- cache = Caffeine.newBuilder().maximumSize(10_000).expireAfterWrite(1, TimeUnit.MINUTES).build();
- }
-
- /**
- * Create instance of {@link CaffeineBookmarkManager} with provided cache
- *
- * @param cache cache
- */
- public CaffeineBookmarkManager(Cache cache) {
- this.cache = cache;
- }
-
- @Override
- public Collection getBookmarks() {
- // return defensive copy
- return new HashSet<>(cache.asMap().values());
- }
-
- @Override
- public void storeBookmark(String bookmark, Collection previous) {
- // first invalidate previous bookmarks, because bookmark may be in `previous` collection for
- // transaction, which didn't make any changes
-
- cache.invalidateAll(previous);
- cache.put(bookmark, bookmark);
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/package-info.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/package-info.java
deleted file mode 100644
index d75f43004..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/bookmark/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Support for Neo4js bookmarks for use with the java driver / bolt transport.
- */
-package org.springframework.data.neo4j.bookmark;
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/MetaDataDrivenConversionService.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/MetaDataDrivenConversionService.java
deleted file mode 100644
index 0879b416b..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/MetaDataDrivenConversionService.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.conversion;
-
-import java.util.Optional;
-
-import org.neo4j.ogm.metadata.ClassInfo;
-import org.neo4j.ogm.metadata.FieldInfo;
-import org.neo4j.ogm.metadata.MetaData;
-import org.neo4j.ogm.typeconversion.AttributeConverter;
-import org.neo4j.ogm.typeconversion.ProxyAttributeConverter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.ResolvableType;
-import org.springframework.core.convert.converter.Converter;
-import org.springframework.core.convert.support.GenericConversionService;
-
-/**
- * Specialisation of {@link GenericConversionService} that creates Spring-compatible converters from those known by the
- * mapping {@link MetaData}, allowing the OGM type converters to be reused throughout a Spring application.
- *
- * @author Adam George
- * @author Luanne Misquitta
- * @author Jasper Blues
- * @author Michael J. Simons
- */
-public class MetaDataDrivenConversionService extends GenericConversionService {
-
- private static final Logger logger = LoggerFactory.getLogger(MetaDataDrivenConversionService.class);
-
- /**
- * Constructs a new {@link MetaDataDrivenConversionService} based on the given {@link MetaData}.
- *
- * @param metaData The OGM {@link MetaData} from which to elicit type converters configured in the underlying
- * object-graph mapping layer
- */
- public MetaDataDrivenConversionService(MetaData metaData) {
-
- for (ClassInfo classInfo : metaData.persistentEntities()) {
- for (FieldInfo fieldInfo : classInfo.propertyFields()) {
- if (fieldInfo.hasPropertyConverter()) {
- addWrappedConverter(fieldInfo.getPropertyConverter());
- }
- }
- }
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- private void addWrappedConverter(final AttributeConverter attributeConverter) {
-
- if (attributeConverter instanceof ProxyAttributeConverter) {
- return;
- }
-
- EntityToGraphTypeMapping entityToGraphTypeMapping = getEntityToGraphTypeMapping(attributeConverter);
-
- if (canConvert(entityToGraphTypeMapping.entityType, entityToGraphTypeMapping.graphType)
- && canConvert(entityToGraphTypeMapping.graphType, entityToGraphTypeMapping.entityType)) {
- logger.debug("Not adding Spring-compatible converter for " + attributeConverter.getClass()
- + " because one that does the same job has already been registered with the ConversionService.");
- } else {
- Converter toGraphConverter = attributeConverter::toGraphProperty;
- Converter toEntityConverter = attributeConverter::toEntityAttribute;
-
- // It could be argued that this is wrong as it potentially overrides a registered converted that doesn't handle
- // both directions, but I've decided that it's better to ensure the same converter is used for load and save.
- addConverter(entityToGraphTypeMapping.entityType, entityToGraphTypeMapping.graphType, toGraphConverter);
- addConverter(entityToGraphTypeMapping.graphType, entityToGraphTypeMapping.entityType, toEntityConverter);
- }
- }
-
- static class EntityToGraphTypeMapping {
- Class> entityType;
- Class> graphType;
-
- private EntityToGraphTypeMapping(Class> entityType, Class> target) {
- this.entityType = entityType;
- this.graphType = target;
- }
- }
-
- static EntityToGraphTypeMapping getEntityToGraphTypeMapping(AttributeConverter attributeConverter) {
-
- ResolvableType resolvableType = ResolvableType.forClass(AttributeConverter.class,
- attributeConverter.getClass());
-
- if (!resolvableType.hasGenerics()) {
- throw new IllegalStateException(
- "Cannot resolve source and target types for the given attribute converter of class "
- + attributeConverter.getClass());
- }
-
- Class> sourceType = nestedTypeOrType(resolvableType.getGeneric(0));
- Class> targetType = nestedTypeOrType(resolvableType.getGeneric(1));
-
- return new EntityToGraphTypeMapping(sourceType, targetType);
- }
-
- /**
- * If the type can be resolved to a collection that has generics, we extract the collection type, otherwise we return
- * the resolved type.
- *
- * @param type Type to resolve
- * @return The types resolved class or in case of a generic collections, the collections elements class.
- */
- private static Class> nestedTypeOrType(ResolvableType type) {
- return Optional.ofNullable(type.asCollection()).filter(ResolvableType::hasGenerics).map(r -> r.getGeneric(0))
- .orElse(type).resolve(Object.class);
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/Neo4jOgmEntityInstantiatorAdapter.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/Neo4jOgmEntityInstantiatorAdapter.java
deleted file mode 100644
index dd5744d8e..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/Neo4jOgmEntityInstantiatorAdapter.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.conversion;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Map;
-
-import org.neo4j.ogm.metadata.reflect.EntityAccessManager;
-import org.springframework.core.convert.ConversionService;
-import org.springframework.data.convert.EntityInstantiator;
-import org.springframework.data.mapping.PreferredConstructor;
-import org.springframework.data.mapping.context.MappingContext;
-import org.springframework.data.mapping.model.ParameterValueProvider;
-import org.springframework.data.neo4j.mapping.Neo4jMappingContext;
-import org.springframework.data.neo4j.mapping.Neo4jPersistentEntity;
-import org.springframework.data.neo4j.mapping.Neo4jPersistentProperty;
-import org.springframework.data.util.TypeInformation;
-import org.springframework.lang.Nullable;
-import org.springframework.util.Assert;
-
-/**
- * Implements OGM instantiation callback in order to user Spring Data Commons infrastructure for instantiation.
- *
- * @author Nicolas Mervaillie
- * @author Michael J. Simons
- */
-public class Neo4jOgmEntityInstantiatorAdapter implements org.neo4j.ogm.session.EntityInstantiator {
-
- private final Neo4jMappingContext context;
- private ConversionService conversionService;
-
- public Neo4jOgmEntityInstantiatorAdapter(MappingContext, Neo4jPersistentProperty> context,
- @Nullable ConversionService conversionService) {
- Assert.notNull(context, "MappingContext cannot be null");
-
- this.context = (Neo4jMappingContext) context;
- this.conversionService = conversionService;
- }
-
- @SuppressWarnings({ "unchecked" })
- @Override
- public T createInstance(Class clazz, Map propertyValues) {
-
- Neo4jPersistentEntity persistentEntity = (Neo4jPersistentEntity) context.getRequiredPersistentEntity(clazz);
- EntityInstantiator sdnInstantiator = context.getInstantiatorFor(persistentEntity);
-
- return sdnInstantiator.createInstance(persistentEntity, getParameterProvider(propertyValues, conversionService));
- }
-
- private ParameterValueProvider getParameterProvider(Map propertyValues,
- ConversionService conversionService) {
- return new Neo4jPropertyValueProvider(propertyValues, conversionService);
- }
-
- private static class Neo4jPropertyValueProvider implements ParameterValueProvider {
-
- private Map propertyValues;
- private ConversionService conversionService;
-
- Neo4jPropertyValueProvider(Map propertyValues, ConversionService conversionService) {
- this.conversionService = conversionService;
- Assert.notNull(propertyValues, "Properties cannot be null");
- this.propertyValues = propertyValues;
- }
-
- @SuppressWarnings({ "unchecked" })
- @Override
- @Nullable
- public Object getParameterValue(PreferredConstructor.Parameter parameter) {
-
- Object value = extractParameterValue(parameter);
- if (value == null || conversionService == null) {
- return value;
- } else {
- return conversionService.convert(value, parameter.getType().getType());
- }
- }
-
- private Object extractParameterValue(PreferredConstructor.Parameter parameter) {
-
- Object value = propertyValues.get(parameter.getName());
-
- // This recreates the behaviour of
- // org.neo4j.ogm.context.SingleUseEntityMapper.writeProperty and
- // org.neo4j.ogm.context.GraphEntityMapper.writeProperty
- // As sad as it is to have in 3 places, this is the least invasive solution over both Neo4j-OGM and SDN
- if (value != null && value.getClass().isArray()) {
- value = Arrays.asList((Object[]) value);
- }
- TypeInformation typeInformation = parameter.getType();
- if (typeInformation.isCollectionLike()) {
- Class> collectionType = typeInformation.getType();
- Class> elementType = typeInformation.getComponentType().getType();
- value = collectionType.isArray()
- ? EntityAccessManager.merge(collectionType, value, new Object[] {}, elementType)
- : EntityAccessManager.merge(collectionType, value, Collections.EMPTY_LIST, elementType);
- }
- return value;
- }
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/PointConverter.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/PointConverter.java
deleted file mode 100644
index 1c66c2422..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/PointConverter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.conversion;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.neo4j.ogm.typeconversion.CompositeAttributeConverter;
-import org.springframework.data.geo.Point;
-
-/**
- * Converts latitude and longitude properties on a node entity to an instance of Point and vice-versa.
- *
- * @see Point
- * @author Jasper Blues
- */
-public class PointConverter implements CompositeAttributeConverter {
-
- @Override
- public Map toGraphProperties(Point point) {
- Map properties = new HashMap<>();
- if (point != null) {
- properties.put("latitude", point.getX());
- properties.put("longitude", point.getY());
- }
- return properties;
- }
-
- @Override
- public Point toEntityAttribute(Map map) {
- Double latitude = (Double) map.get("latitude");
- Double longitude = (Double) map.get("longitude");
- if (latitude != null && longitude != null) {
- return new Point(latitude, longitude);
- }
- return null;
- }
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/package-info.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/package-info.java
deleted file mode 100644
index f0fdebf7d..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/conversion/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Adapter between Springs {@link org.springframework.core.convert.ConversionService conversion service infrastructure}
- * and OGM infrastructure.
- */
-package org.springframework.data.neo4j.conversion;
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/Neo4jErrorStatusCodes.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/Neo4jErrorStatusCodes.java
deleted file mode 100644
index 5db8483c5..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/Neo4jErrorStatusCodes.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.exception;
-
-import java.util.HashMap;
-
-import org.springframework.dao.*;
-
-/**
- * Conversion table for Neo4j Errors to Spring Data Exception hierarchy.
- *
- * @author Mark Angrish
- */
-public class Neo4jErrorStatusCodes {
-
- private static HashMap> errors;
-
- static {
- errors = new HashMap<>();
- errors.put("Neo.ClientError.General.ForbiddenOnReadOnlyDatabase", PermissionDeniedDataAccessException.class);
- errors.put("Neo.ClientError.LegacyIndex.LegacyIndexNotFound", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Procedure.ProcedureCallFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Procedure.ProcedureNotFound", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Procedure.ProcedureRegistrationFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Procedure.TypeError", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Request.Invalid", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Request.InvalidFormat", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Request.TransactionRequired", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Schema.ConstraintAlreadyExists", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Schema.ConstraintNotFound", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Schema.ConstraintValidationFailed", DataIntegrityViolationException.class);
- errors.put("Neo.ClientError.Schema.ConstraintVerificationFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Schema.ForbiddenOnConstraintIndex", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Schema.IndexAlreadyExists", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Schema.IndexNotFound", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Schema.TokenNameError", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Security.AuthenticationRateLimit", PermissionDeniedDataAccessException.class);
- errors.put("Neo.ClientError.Security.CredentialsExpired", PermissionDeniedDataAccessException.class);
- errors.put("Neo.ClientError.Security.EncryptionRequired", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Security.Forbidden", PermissionDeniedDataAccessException.class);
- errors.put("Neo.ClientError.Security.Unauthorized", PermissionDeniedDataAccessException.class);
- errors.put("Neo.ClientError.Statement.ArgumentError", InvalidDataAccessApiUsageException.class);
- errors.put("Neo.ClientError.Statement.ArithmeticError", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Statement.ConstraintVerificationFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Statement.EntityNotFound", EmptyResultDataAccessException.class);
- errors.put("Neo.ClientError.Statement.ExternalResourceFailed", NonTransientDataAccessResourceException.class);
- errors.put("Neo.ClientError.Statement.LabelNotFound", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Statement.ParameterMissing", InvalidDataAccessApiUsageException.class);
- errors.put("Neo.ClientError.Statement.PropertyNotFound", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Statement.SemanticError", NonTransientDataAccessException.class);
- errors.put("Neo.ClientError.Statement.SyntaxError", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Statement.TypeError", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Transaction.ForbiddenDueToTransactionType",
- InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Transaction.TransactionAccessedConcurrently",
- InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Transaction.TransactionEventHandlerFailed",
- InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Transaction.TransactionHookFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Transaction.TransactionMarkedAsFailed", ConcurrencyFailureException.class);
- errors.put("Neo.ClientError.Transaction.TransactionNotFound", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Transaction.TransactionTerminated", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.ClientError.Transaction.TransactionValidationFailed",
- InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.General.IndexCorruptionDetected", DataAccessResourceFailureException.class);
- errors.put("Neo.DatabaseError.General.SchemaCorruptionDetected", DataAccessResourceFailureException.class);
- errors.put("Neo.DatabaseError.General.UnknownError", UncategorizedDataAccessException.class);
- errors.put("Neo.DatabaseError.Schema.ConstraintCreationFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.ConstraintDropFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.IndexCreationFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.IndexDropFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.LabelAccessFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.LabelLimitReached", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.PropertyKeyAccessFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.RelationshipTypeAccessFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.SchemaRuleAccessFailed", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Schema.SchemaRuleDuplicateFound", InvalidDataAccessResourceUsageException.class);
- errors.put("Neo.DatabaseError.Statement.ExecutionFailed", TransientDataAccessResourceException.class);
- errors.put("Neo.DatabaseError.Transaction.TransactionCommitFailed", TransientDataAccessResourceException.class);
- errors.put("Neo.DatabaseError.Transaction.TransactionLogError", TransientDataAccessResourceException.class);
- errors.put("Neo.DatabaseError.Transaction.TransactionRollbackFailed", TransientDataAccessResourceException.class);
- errors.put("Neo.DatabaseError.Transaction.TransactionStartFailed", TransientDataAccessResourceException.class);
- errors.put("Neo.TransientError.General.DatabaseUnavailable", TransientDataAccessResourceException.class);
- errors.put("Neo.TransientError.General.OutOfMemoryError", NonTransientDataAccessResourceException.class);
- errors.put("Neo.TransientError.General.StackOverFlowError", NonTransientDataAccessResourceException.class);
- errors.put("Neo.TransientError.Network.CommunicationError", DataAccessResourceFailureException.class);
- errors.put("Neo.TransientError.Schema.SchemaModifiedConcurrently", ConcurrencyFailureException.class);
- errors.put("Neo.TransientError.Security.ModifiedConcurrently", ConcurrencyFailureException.class);
- errors.put("Neo.TransientError.Transaction.ConstraintsChanged", ConcurrencyFailureException.class);
- errors.put("Neo.TransientError.Transaction.DeadlockDetected", ConcurrencyFailureException.class);
- errors.put("Neo.TransientError.Transaction.InstanceStateChanged", ConcurrencyFailureException.class);
- errors.put("Neo.TransientError.Transaction.LockClientStopped", NonTransientDataAccessResourceException.class);
- errors.put("Neo.TransientError.Transaction.LockSessionExpired", DataAccessResourceFailureException.class);
- errors.put("Neo.TransientError.Transaction.Outdated", TransientDataAccessResourceException.class);
- errors.put("Neo.TransientError.Transaction.Terminated", TransientDataAccessResourceException.class);
- }
-
- public static Class extends DataAccessException> translate(String errorCode) {
- return errors.get(errorCode);
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/UncategorizedNeo4jException.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/UncategorizedNeo4jException.java
deleted file mode 100644
index 6c9c4d400..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/UncategorizedNeo4jException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.exception;
-
-import org.springframework.dao.UncategorizedDataAccessException;
-
-/**
- * Exception for unrecognised Neo4j OGM errors.
- *
- * @author Mark Angrish
- */
-public class UncategorizedNeo4jException extends UncategorizedDataAccessException {
-
- public UncategorizedNeo4jException(String msg, Throwable cause) {
- super(msg, cause);
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/package-info.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/package-info.java
deleted file mode 100644
index c40bee015..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/exception/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Contains infrastructure for mapping Neo4j errors to Spring Data Exception hierarchy.
- */
-package org.springframework.data.neo4j.exception;
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/MetaDataProvider.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/MetaDataProvider.java
deleted file mode 100644
index a0812338a..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/MetaDataProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.mapping;
-
-import org.neo4j.ogm.metadata.MetaData;
-
-/**
- * The only meta-data provider currently is a Neo4j-OGM {@link org.neo4j.ogm.session.SessionFactory} by proxy. The
- * meta-data is needed during execution of graph-repository-queries to lookup mappings etc.
- *
- * @author Michael J. Simons
- * @since 5.1.2
- */
-@FunctionalInterface
-public interface MetaDataProvider {
- MetaData getMetaData();
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jMappingContext.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jMappingContext.java
deleted file mode 100644
index 4d8b84652..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jMappingContext.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.mapping;
-
-import static java.util.Collections.*;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Optional;
-import java.util.stream.Stream;
-
-import org.neo4j.ogm.annotation.typeconversion.Convert;
-import org.neo4j.ogm.metadata.ClassInfo;
-import org.neo4j.ogm.metadata.FieldInfo;
-import org.neo4j.ogm.metadata.MetaData;
-import org.neo4j.ogm.typeconversion.AttributeConverter;
-import org.neo4j.ogm.typeconversion.ConverterBasedCollectionConverter;
-import org.neo4j.ogm.types.spatial.CartesianPoint2d;
-import org.neo4j.ogm.types.spatial.GeographicPoint2d;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.data.convert.EntityInstantiator;
-import org.springframework.data.convert.EntityInstantiators;
-import org.springframework.data.geo.Point;
-import org.springframework.data.mapping.PersistentEntity;
-import org.springframework.data.mapping.context.AbstractMappingContext;
-import org.springframework.data.mapping.model.Property;
-import org.springframework.data.mapping.model.SimpleTypeHolder;
-import org.springframework.data.util.TypeInformation;
-import org.springframework.util.ReflectionUtils;
-
-/**
- * This class implements Spring Data's MappingContext interface, scavenging the required data from the OGM's metadata in
- * order to for SDN to play nicely with Spring Data REST. The main thing to note is that this class is effectively a
- * container shim for {@code ClassInfo} objects. We don't reload all the mapping information again.
- *
- * @author Vince Bickers
- * @author Adam George
- * @author Mark Paluch
- * @author Michael J. Simons
- * @since 4.0.0
- */
-public class Neo4jMappingContext extends AbstractMappingContext, Neo4jPersistentProperty> {
-
- private static final Logger logger = LoggerFactory.getLogger(Neo4jMappingContext.class);
-
- // Instantiation of the EntityInstantiators must happen only once, otherwise
- // the org.springframework.data.convert.ClassGeneratingEntityInstantiator will
- // be created every time an instantiator is requested and thus the whole thing
- // will dynamically create classes like there is no tomorrow.
- private final EntityInstantiators instantiators = new EntityInstantiators();
- private final MetaData metaData;
-
- /**
- * Constructs a new {@link Neo4jMappingContext} based on the persistent entities in the given {@link MetaData}.
- *
- * @param metaData The OGM {@link MetaData} from which to extract the persistent entities
- */
- public Neo4jMappingContext(MetaData metaData) {
- this.metaData = metaData;
- metaData.persistentEntities().stream().filter(k -> k.getUnderlyingClass() != null)
- .forEach(k -> addPersistentEntity(k.getUnderlyingClass()));
-
- installDefaultConverter();
-
- logger.info("Neo4jMappingContext initialisation completed");
- }
-
- private void installDefaultConverter() {
-
- Method setPropertyConverter = ReflectionUtils.findMethod(FieldInfo.class, "setPropertyConverter",
- AttributeConverter.class);
-
- if (setPropertyConverter == null) {
- return;
- }
-
- setPropertyConverter.setAccessible(true);
-
- NativePointConverter nativePointConverter = new NativePointConverter();
- NativePointArrayConverter nativePointArrayConverter = new NativePointArrayConverter();
-
- metaData.persistentEntities().stream().flatMap(classInfo -> Stream
- .concat(classInfo.findFields(Point.class).stream(), classInfo.findIterableFields(Point.class).stream()))
- .distinct().forEach(fieldInfo -> {
-
- AttributeConverter, ?> propertyConverter;
- if (fieldInfo.isArray()) {
- propertyConverter = nativePointArrayConverter;
- } else if (fieldInfo.isIterable()) {
- propertyConverter = new ConverterBasedCollectionConverter(fieldInfo.getField().getType(),
- nativePointConverter);
- } else {
- propertyConverter = nativePointConverter;
- }
-
- ReflectionUtils.invokeMethod(setPropertyConverter, fieldInfo, propertyConverter);
- });
- }
-
- @Override
- protected Neo4jPersistentEntity> createPersistentEntity(TypeInformation typeInformation) {
- logger.debug("Creating Neo4jPersistentEntity from type information: {}", typeInformation);
- return new Neo4jPersistentEntity<>(typeInformation);
- }
-
- @Override
- protected Neo4jPersistentProperty createPersistentProperty(Property property, Neo4jPersistentEntity> owner,
- SimpleTypeHolder simpleTypeHolder) {
-
- ClassInfo owningClassInfo = this.metaData.classInfo(owner.getType().getName());
-
- Field propertyField = property.getField().orElse(null);
-
- if (!property.isFieldBacked() && owningClassInfo != null) {
- FieldInfo fieldInfo = owningClassInfo.propertyFieldByName(property.getName());
- if (fieldInfo == null) {
- fieldInfo = owningClassInfo.relationshipFieldByName(property.getName());
- }
- if (fieldInfo != null) {
- propertyField = owningClassInfo.getField(fieldInfo);
- } else {
- // there is no field, probably because descriptor gave us a field name derived from a getter
- logger.debug("Couldn't resolve a concrete field corresponding to property {} on {} ", property.getName(),
- owningClassInfo.name());
- }
- }
-
- return new Neo4jPersistentProperty(owningClassInfo, property, owner,
- updateSimpleTypeHolder(simpleTypeHolder, propertyField));
- }
-
- public EntityInstantiator getInstantiatorFor(PersistentEntity, ?> entity) {
- return instantiators.getInstantiatorFor(entity);
- }
-
- private SimpleTypeHolder updateSimpleTypeHolder(SimpleTypeHolder currentSimpleTypeHolder, Field field) {
- if (field == null) {
- return currentSimpleTypeHolder;
- }
-
- final Class> fieldType = field.getType().isArray() ? field.getType().getComponentType() : field.getType();
-
- if (shouldUpdateSimpleTypes(currentSimpleTypeHolder, field, fieldType)) {
- SimpleTypeHolder updatedSimpleTypeHolder = new SimpleTypeHolder(singleton(fieldType), currentSimpleTypeHolder);
- setSimpleTypeHolder(updatedSimpleTypeHolder);
- return updatedSimpleTypeHolder;
- }
- return currentSimpleTypeHolder;
- }
-
- private boolean shouldUpdateSimpleTypes(SimpleTypeHolder currentSimpleTypeHolder, Field field,
- Class> rawFieldType) {
- if (field.isAnnotationPresent(Convert.class)) {
- return true;
- }
-
- if (currentSimpleTypeHolder.isSimpleType(rawFieldType) || rawFieldType.isInterface()) {
- return false;
- }
- if (this.metaData.classInfo(rawFieldType.getName()) == null) {
- logger.info("No class information found in OGM meta-data for {} so treating as simple type for SD Commons",
- rawFieldType);
- return true;
- }
- return false;
- }
-
- /**
- * This is used internally for automatic conversion of Spring Data Point to a fitting Neo4j point. While OGM native
- * types treat longitude as x and latitude as y, we apply the same behaviour as SDN: x/y -> lat/long. We need however
- * a geographic type, as all calculations expected from Spring Data are usually based on WGS-84 If you want to be
- * explicit which coordinate system you use, please use {@link org.neo4j.ogm.types.spatial.GeographicPoint2d} or
- * {@link CartesianPoint2d} in your domain model.
- */
- private static class NativePointConverter implements AttributeConverter {
-
- @Override
- public GeographicPoint2d toGraphProperty(Point value) {
-
- return Optional.ofNullable(value).map(p -> new GeographicPoint2d(value.getX(), value.getY())).orElse(null);
- }
-
- @Override
- public Point toEntityAttribute(GeographicPoint2d value) {
-
- return Optional.ofNullable(value).map(p -> new Point(value.getLatitude(), value.getLongitude())).orElse(null);
- }
- }
-
- /**
- * Wrapper delegating to {@link NativePointConverter} for arrays of points.
- */
- private static class NativePointArrayConverter implements AttributeConverter {
-
- private final NativePointConverter delegate = new NativePointConverter();
-
- @Override
- public GeographicPoint2d[] toGraphProperty(Point[] value) {
-
- if (value == null) {
- return null;
- }
-
- return Arrays.stream(value).map(delegate::toGraphProperty).toArray(GeographicPoint2d[]::new);
- }
-
- @Override
- public Point[] toEntityAttribute(GeographicPoint2d[] value) {
-
- if (value == null) {
- return null;
- }
-
- return Arrays.stream(value).map(delegate::toEntityAttribute).toArray(Point[]::new);
- }
- }
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jPersistentEntity.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jPersistentEntity.java
deleted file mode 100644
index 654f9dc6f..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jPersistentEntity.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.mapping;
-
-import org.springframework.data.mapping.MappingException;
-import org.springframework.data.mapping.PersistentProperty;
-import org.springframework.data.mapping.model.BasicPersistentEntity;
-import org.springframework.data.neo4j.mapping.Neo4jPersistentProperty.PropertyType;
-import org.springframework.data.support.IsNewStrategy;
-import org.springframework.data.util.TypeInformation;
-
-/**
- * This class implements Spring Data's PersistentEntity interface, scavenging the required data from the OGM's mapping
- * classes in order to for SDN to play nicely with Spring Data REST. The main thing to note is that this class is
- * effectively a shim for ClassInfo. We don't reload all the mapping information again.
- *
- * These attributes do not appear to be used/needed for SDN 4 to inter-operate correctly with SD-REST:
- *
- *
- *
typeAlias
- *
typeInformation
- *
preferredConstructor (we always use the default constructor)
- *
versionProperty
- *
- * Consequently their associated getter methods always return default values of null or [true|false] However, because
- * these method calls are not expected, we also log a warning message if they get invoked
- *
- * @author Vince Bickers
- * @author Adam George
- * @author Mark Paluch
- * @author Oliver Gierke
- * @author Michael J. Simons
- * @since 4.0.0
- */
-public class Neo4jPersistentEntity extends BasicPersistentEntity {
-
- /**
- * Constructs a new {@link Neo4jPersistentEntity} based on the given type information.
- *
- * @param information The {@link TypeInformation} upon which to base this persistent entity.
- */
- Neo4jPersistentEntity(TypeInformation information) {
- super(information);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.mapping.model.BasicPersistentEntity#getFallbackIsNewStrategy()
- */
- @Override
- protected IsNewStrategy getFallbackIsNewStrategy() {
- return new Neo4jIsNewStrategy(this);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.mapping.model.BasicPersistentEntity#returnPropertyIfBetterIdPropertyCandidateOrNull(PersistentProperty)
- */
- @Override
- protected Neo4jPersistentProperty returnPropertyIfBetterIdPropertyCandidateOrNull(Neo4jPersistentProperty property) {
-
- if (!property.isIdProperty()) {
- return null;
- }
-
- Neo4jPersistentProperty existingIdProperty = this.getIdProperty();
- Neo4jPersistentProperty preferredIdProperty = existingIdProperty;
-
- if (existingIdProperty == null) {
- preferredIdProperty = property;
- } else if (existingIdProperty.getPropertyType() == property.getPropertyType()) {
- throw new MappingException(
- String.format("Attempt to add id property %s but already have property %s registered "
- + "as id. Check your mapping configuration!", property.getField(),
- existingIdProperty.getField()));
- } else if (existingIdProperty.getPropertyType() == PropertyType.INTERNAL_ID_PROPERTY && property.getPropertyType() == PropertyType.ID_PROPERTY) {
- preferredIdProperty = property;
- }
- return preferredIdProperty;
- }
-
- /**
- * Custom {@link IsNewStrategy} to also consider entities with identifiers of negative Long values new.
- * See also DATAGRAPH-1031.
- *
- * @author Frantisek Hartman
- * @author Oliver Gierke
- */
- private static class Neo4jIsNewStrategy implements IsNewStrategy {
-
- private final Neo4jPersistentEntity> entity;
-
- private Neo4jIsNewStrategy(Neo4jPersistentEntity> entity) {
- this.entity = entity;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.support.IsNewStrategy#isNew(java.lang.Object)
- */
- @Override
- public boolean isNew(Object bean) {
-
- PersistentProperty extends PersistentProperty>> property = entity.getRequiredIdProperty();
- Object value = entity.getPropertyAccessor(bean).getProperty(property);
-
- return value == null || (value instanceof Long && ((Long) value) < 0);
- }
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jPersistentProperty.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jPersistentProperty.java
deleted file mode 100644
index 74b60826a..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/Neo4jPersistentProperty.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.mapping;
-
-import java.lang.reflect.Field;
-import java.util.Optional;
-
-import org.neo4j.ogm.annotation.EndNode;
-import org.neo4j.ogm.annotation.Id;
-import org.neo4j.ogm.annotation.Relationship;
-import org.neo4j.ogm.annotation.StartNode;
-import org.neo4j.ogm.annotation.Version;
-import org.neo4j.ogm.metadata.ClassInfo;
-import org.neo4j.ogm.metadata.FieldInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.annotation.AnnotatedElementUtils;
-import org.springframework.data.mapping.Association;
-import org.springframework.data.mapping.PersistentEntity;
-import org.springframework.data.mapping.model.AnnotationBasedPersistentProperty;
-import org.springframework.data.mapping.model.Property;
-import org.springframework.data.mapping.model.SimpleTypeHolder;
-import org.springframework.data.neo4j.annotation.QueryResult;
-
-/**
- * This class implements Spring Data's PersistentProperty interface, scavenging the required data from the OGM's mapping
- * classes in order to for SDN to play nicely with Spring Data REST. The main thing to note is that this class is
- * effectively a shim for FieldInfo. We don't reload all the mapping information again. We do not yet support
- * getter/setter access to entity properties.
- *
- * These attributes do not appear to be used/needed for SDN 4 to inter-operate correctly with SD-REST:
- *
- *
- *
mapValueType
- *
typeInformation
- *
isVersionProperty (there is no SDN versioning at this stage)
- *
isTransient (we never supply transient classes to the Spring mapping context)
- *
isWritable (we don't currently support read-only fields)
- *
- * Consequently their associated getter methods always return default values of null or [true|false] However, because
- * these method calls are not expected, we also log a warning message if they get invoked
- *
- * @author Vince Bickers
- * @author Adam George
- * @author Luanne Misquitta
- * @author Mark Angrish
- * @author Mark Paluch
- * @author Michael J. Simons
- * @since 4.0.0
- */
-public class Neo4jPersistentProperty extends AnnotationBasedPersistentProperty {
-
- private static final Logger logger = LoggerFactory.getLogger(Neo4jPersistentProperty.class);
-
- enum PropertyType {
- REGULAR_PROPERTY(false), INTERNAL_ID_PROPERTY(true), ID_PROPERTY(true);
-
- private final boolean idProperty;
-
- PropertyType(boolean idProperty) {
- this.idProperty = idProperty;
- }
- }
-
- private final PropertyType propertyType;
-
- /**
- * Constructs a new {@link Neo4jPersistentProperty} based on the given arguments.
- *
- * @param owningClassInfo The {@link ClassInfo} of the object of which the property field is a member
- * @param property The property
- * @param owner The owning {@link PersistentEntity} that corresponds to the given {@code ClassInfo}
- * @param simpleTypeHolder The {@link SimpleTypeHolder} that dictates whether the type of this property is considered
- * simple or not
- */
- public Neo4jPersistentProperty(ClassInfo owningClassInfo, Property property,
- PersistentEntity, Neo4jPersistentProperty> owner, SimpleTypeHolder simpleTypeHolder) {
- super(property, owner, simpleTypeHolder);
-
- if (owningClassInfo == null) {
- logger.warn("Owning ClassInfo is null for property: {}", property);
- }
-
- if (owningClassInfo == null || owningClassIsSimple(owningClassInfo, simpleTypeHolder)
- || owningClassDoesNotSupportIdProperties(owningClassInfo) || owningPropertyIsEnum(owner)) {
- this.propertyType = PropertyType.REGULAR_PROPERTY;
- } else if (isInternalIdentityField(owningClassInfo, property)) {
- this.propertyType = PropertyType.INTERNAL_ID_PROPERTY;
- } else if (isExplicitIdentityField(owningClassInfo, property)) {
- this.propertyType = PropertyType.ID_PROPERTY;
- } else {
- this.propertyType = PropertyType.REGULAR_PROPERTY;
- }
- }
-
- private static boolean owningPropertyIsEnum(PersistentEntity, Neo4jPersistentProperty> owner) {
- return owner.getType().isEnum();
- }
-
- private static boolean owningClassIsSimple(ClassInfo owningClassInfo, SimpleTypeHolder simpleTypeHolder) {
-
- return owningClassInfo.getUnderlyingClass() != null
- && simpleTypeHolder.isSimpleType(owningClassInfo.getUnderlyingClass());
- }
-
- private static boolean owningClassDoesNotSupportIdProperties(ClassInfo owningClassInfo) {
-
- return owningClassInfo.isInterface() || owningClassInfo.annotationsInfo().get(QueryResult.class.getName()) != null
- || owningClassInfo.isEnum();
- }
-
- private static boolean isInternalIdentityField(ClassInfo owningClassInfo, Property property) {
-
- Optional optionalInternalIdentityField = Optional.ofNullable(owningClassInfo.identityFieldOrNull())
- .map(FieldInfo::getField);
- return property.getField().equals(optionalInternalIdentityField);
- }
-
- private static boolean isExplicitIdentityField(ClassInfo owningClassInfo, Property property) {
-
- // Cannot use owningClassInfo.propertyField() as those are not initialized yet. They will
- // be initialized on the call, but that would change behaviour: SDN fails late when there
- // are invalid properties atm. Even if'ts better to fail early, it means at least changing
- // a dozen tests in SDN itself.
- return property.getField().map(field -> AnnotatedElementUtils.findMergedAnnotation(field, Id.class)).isPresent();
- }
-
- @Override
- public boolean isIdProperty() {
- return propertyType.idProperty;
- }
-
- /**
- * @return True if this property describes the internal ID property.
- */
- public boolean isInternalIdProperty() {
- return propertyType == PropertyType.INTERNAL_ID_PROPERTY;
- }
-
- PropertyType getPropertyType() {
- return propertyType;
- }
-
- @Override
- public boolean isVersionProperty() {
- return isAnnotationPresent(Version.class);
- }
-
- /**
- * Overridden to force field access as opposed to getter method access for simplicity.
- *
- * @see org.springframework.data.mapping.model.AnnotationBasedPersistentProperty#usePropertyAccess()
- */
- @Override
- public boolean usePropertyAccess() {
- logger.debug("[property].usePropertyAccess() returns false");
- return false;
- }
-
- /**
- * Determines whether or not this property should be considered an association to another entity or whether it's just
- * a simple property that should be shown as a value.
- *
- * This implementation works by looking for non-transient members annotated with @Relationship.
- *
- *
- * @return true if this property is an association to another entity, false if not
- */
- @Override
- public boolean isAssociation() {
- return !isTransient() && (isAnnotationPresent(Relationship.class) || isAnnotationPresent(StartNode.class)
- || isAnnotationPresent(EndNode.class));
- }
-
- @Override
- protected Association createAssociation() {
- return new Association(this, null);
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/package-info.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/package-info.java
deleted file mode 100644
index b2831413d..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/mapping/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Neo4j specific support classes for the Spring Data mapping subsystem.
- */
-package org.springframework.data.neo4j.mapping;
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/Neo4jRepository.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/Neo4jRepository.java
deleted file mode 100644
index c807f0103..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/Neo4jRepository.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository;
-
-import java.io.Serializable;
-import java.util.Optional;
-
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.domain.Sort;
-import org.springframework.data.repository.NoRepositoryBean;
-import org.springframework.data.repository.PagingAndSortingRepository;
-
-/**
- * Neo4j OGM specific extension of {@link org.springframework.data.repository.Repository}.
- *
- * @author Vince Bickers
- * @author Mark Angrish
- * @author Mark Paluch
- * @author Jens Schauder
- */
-@NoRepositoryBean
-public interface Neo4jRepository extends PagingAndSortingRepository {
-
- S save(S s, int depth);
-
- Iterable save(Iterable entities, int depth);
-
- Optional findById(ID id, int depth);
-
- Iterable findAll();
-
- Iterable findAll(int depth);
-
- Iterable findAll(Sort sort);
-
- Iterable findAll(Sort sort, int depth);
-
- Iterable findAllById(Iterable ids);
-
- Iterable findAllById(Iterable ids, int depth);
-
- Iterable findAllById(Iterable ids, Sort sort);
-
- Iterable findAllById(Iterable ids, Sort sort, int depth);
-
- /**
- * Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
- * {@link Page#getTotalPages()} returns an estimation of the total number of pages and should not be relied upon for
- * accuracy.
- *
- * @param pageable
- * @return a page of entities
- */
- Page findAll(Pageable pageable);
-
- /**
- * Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
- * {@link Page#getTotalPages()} returns an estimation of the total number of pages and should not be relied upon for
- * accuracy.
- *
- * @param pageable
- * @param depth
- * @return a page of entities
- */
- Page findAll(Pageable pageable, int depth);
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/Neo4jCdiRepositoryBean.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/Neo4jCdiRepositoryBean.java
deleted file mode 100644
index ec90cbc41..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/Neo4jCdiRepositoryBean.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.cdi;
-
-import java.lang.annotation.Annotation;
-import java.util.Optional;
-import java.util.Set;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.neo4j.ogm.session.Session;
-import org.springframework.data.neo4j.repository.support.Neo4jRepositoryFactory;
-import org.springframework.data.repository.cdi.CdiRepositoryBean;
-import org.springframework.data.repository.config.CustomRepositoryImplementationDetector;
-
-/**
- * {@link org.springframework.data.repository.cdi.CdiRepositoryBean} to create Neo4j repository instances via CDI.
- *
- * @author Mark Paluch
- * @since 4.2
- */
-public class Neo4jCdiRepositoryBean extends CdiRepositoryBean {
- private final Bean sessionBean;
-
- /**
- * Creates a new {@link Neo4jCdiRepositoryBean}.
- *
- * @param sessionBean must not be {@literal null}.
- * @param qualifiers must not be {@literal null}.
- * @param repositoryType must not be {@literal null}.
- * @param beanManager must not be {@literal null}.
- * @param detector detector for the custom {@link org.springframework.data.repository.Repository} implementations
- * {@link CustomRepositoryImplementationDetector}, can be {@literal null}.
- */
- public Neo4jCdiRepositoryBean(Bean sessionBean, Set qualifiers, Class repositoryType,
- BeanManager beanManager, Optional detector) {
- super(qualifiers, repositoryType, beanManager, detector);
- this.sessionBean = sessionBean;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.cdi.CdiRepositoryBean#create(javax.enterprise.context.spi.CreationalContext, java.lang.Class)
- */
- @Override
- protected T create(CreationalContext creationalContext, Class repositoryType) {
-
- Session session = getDependencyInstance(sessionBean, Session.class);
-
- return create(() -> new Neo4jRepositoryFactory(session), repositoryType);
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/Neo4jCdiRepositoryExtension.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/Neo4jCdiRepositoryExtension.java
deleted file mode 100644
index 1faa308e5..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/Neo4jCdiRepositoryExtension.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.ProcessBean;
-
-import org.neo4j.ogm.session.Session;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.data.repository.cdi.CdiRepositoryBean;
-import org.springframework.data.repository.cdi.CdiRepositoryExtensionSupport;
-
-/**
- * CDI extension to export Neo4j repositories.
- *
- * @author Mark Paluch
- * @since 4.2
- */
-public class Neo4jCdiRepositoryExtension extends CdiRepositoryExtensionSupport {
-
- private static final Logger LOG = LoggerFactory.getLogger(Neo4jCdiRepositoryExtension.class);
- private final Map, Bean> sessions = new HashMap, Bean>();
-
- public Neo4jCdiRepositoryExtension() {
- LOG.info("Activating CDI extension for Spring Data Neo4j repositories.");
- }
-
- @SuppressWarnings("unchecked")
- void processBean(@Observes ProcessBean processBean) {
- Bean bean = processBean.getBean();
-
- for (Type type : bean.getTypes()) {
- if (type instanceof Class> && Session.class.isAssignableFrom((Class>) type)) {
-
- if (LOG.isDebugEnabled()) {
- LOG.debug(String.format("Discovered %s with qualifiers %s.", Session.class.getName(), bean.getQualifiers()));
- }
-
- sessions.put(new HashSet(bean.getQualifiers()), (Bean) bean);
- }
- }
- }
-
- void afterBeanDiscovery(@Observes AfterBeanDiscovery afterBeanDiscovery, BeanManager beanManager) {
-
- for (Entry, Set> entry : getRepositoryTypes()) {
-
- Class> repositoryType = entry.getKey();
- Set qualifiers = entry.getValue();
-
- // Create the bean representing the repository.
- CdiRepositoryBean> repositoryBean = createRepositoryBean(repositoryType, qualifiers, beanManager);
- if (LOG.isInfoEnabled()) {
- LOG.info(String.format("Registering bean for %s with qualifiers %s.", repositoryType.getName(), qualifiers));
- }
-
- // Register the bean to the container.
- registerBean(repositoryBean);
- afterBeanDiscovery.addBean(repositoryBean);
- }
- }
-
- /**
- * Creates a {@link Bean}.
- *
- * @param The type of the repository.
- * @param repositoryType The class representing the repository.
- * @param beanManager The BeanManager instance.
- * @return The bean.
- */
- private CdiRepositoryBean createRepositoryBean(Class repositoryType, Set qualifiers,
- BeanManager beanManager) {
- Bean sessionBean = this.sessions.get(qualifiers);
-
- if (sessionBean == null) {
- throw new UnsatisfiedResolutionException(
- String.format("Unable to resolve a bean for '%s' with qualifiers %s.", Session.class.getName(), qualifiers));
- }
-
- return new Neo4jCdiRepositoryBean(sessionBean, qualifiers, repositoryType, beanManager,
- Optional.of(getCustomImplementationDetector()));
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/package-info.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/package-info.java
deleted file mode 100644
index 40d16da26..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/cdi/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * CDI support for Neo4j specific repository implementation.
- */
-package org.springframework.data.neo4j.repository.cdi;
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/EnableNeo4jRepositories.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/EnableNeo4jRepositories.java
deleted file mode 100644
index e4ddcc405..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/EnableNeo4jRepositories.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.config;
-
-import static org.springframework.data.neo4j.repository.config.Neo4jRepositoryConfigurationExtension.*;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Import;
-import org.springframework.data.neo4j.repository.support.Neo4jRepositoryFactoryBean;
-import org.springframework.data.repository.config.DefaultRepositoryBaseClass;
-import org.springframework.data.repository.query.QueryLookupStrategy;
-import org.springframework.transaction.PlatformTransactionManager;
-
-/**
- * Annotation to enable Neo4j repositories. Will scan the package of the annotated configuration class for Spring Data
- * repositories by default.
- *
- * @author Vince Bickers
- * @author Mark Angrish
- * @author Michael J. Simons
- */
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Inherited
-@Import(Neo4jRepositoriesRegistrar.class)
-public @interface EnableNeo4jRepositories {
-
- /**
- * Alias for the {@link #basePackages()} attribute. Allows for more concise annotation declarations e.g.:
- * {@code @EnableExperimentalNeo4jRepositories("org.my.pkg")} instead of
- * {@code @EnableExperimentalNeo4jRepositories(basePackages="org.my.pkg")}.
- */
- String[] value() default {};
-
- /**
- * Base packages to scan for annotated components. {@link #value()} is an alias for (and mutually exclusive with) this
- * attribute. Use {@link #basePackageClasses()} for a type-safe alternative to String-based package names.
- */
- String[] basePackages() default {};
-
- /**
- * Type-safe alternative to {@link #basePackages()} for specifying the packages to scan for annotated components. The
- * package of each class specified will be scanned. Consider creating a special no-op marker class or interface in
- * each package that serves no purpose other than being referenced by this attribute.
- */
- Class>[] basePackageClasses() default {};
-
- /**
- * Specifies which types are eligible for component scanning. Further narrows the set of candidate components from
- * everything in {@link #basePackages()} to everything in the base packages that matches the given filter or filters.
- */
- ComponentScan.Filter[] includeFilters() default {};
-
- /**
- * Specifies which types are not eligible for component scanning.
- */
- ComponentScan.Filter[] excludeFilters() default {};
-
- /**
- * Returns the postfix to be used when looking up custom repository implementations. Defaults to {@literal Impl}. So
- * for a repository named {@code PersonRepository} the corresponding implementation class will be looked up scanning
- * for {@code PersonRepositoryImpl}.
- */
- String repositoryImplementationPostfix() default "Impl";
-
- /**
- * Configures the location of where to find the Spring Data named queries properties file. Will default to
- * {@code META-INFO/neo4j-named-queries.properties}.
- */
- String namedQueriesLocation() default "";
-
- /**
- * Returns the key of the {@link QueryLookupStrategy} to be used for lookup queries for query methods. Defaults to
- * {@link org.springframework.data.repository.query.QueryLookupStrategy.Key#CREATE_IF_NOT_FOUND}.
- */
- QueryLookupStrategy.Key queryLookupStrategy() default QueryLookupStrategy.Key.CREATE_IF_NOT_FOUND;
-
- /**
- * Returns the {@link org.springframework.beans.factory.FactoryBean} class to be used for each repository instance.
- * Defaults to {@link Neo4jRepositoryFactoryBean}.
- */
- Class> repositoryFactoryBeanClass() default Neo4jRepositoryFactoryBean.class;
-
- /**
- * Configure the repository base class to be used to create repository proxies for this particular configuration.
- *
- * @return
- */
- Class> repositoryBaseClass() default DefaultRepositoryBaseClass.class;
-
- /**
- * Configures the name of the {@link org.neo4j.ogm.session.SessionFactory} bean definition to be used to create
- * repositories discovered through this annotation. Defaults to {@code sessionFactory}.
- */
- String sessionFactoryRef() default DEFAULT_SESSION_FACTORY_BEAN_NAME;
-
- /**
- * Configures the name of the {@link org.neo4j.ogm.session.Session} bean definition created. Defaults to a generated
- * name.
- *
- * @since 5.1.0
- */
- String sessionBeanName() default GENERATE_BEAN_NAME;
-
- /**
- * Configures the name of the {@link PlatformTransactionManager} bean definition to be used to create repositories
- * discovered through this annotation. Defaults to {@code transactionManager}.
- */
- String transactionManagerRef() default DEFAULT_TRANSACTION_MANAGER_BEAN_NAME;
-
- /**
- * Configures the name of the {@link org.springframework.data.neo4j.mapping.Neo4jMappingContext} bean definition
- * created. Defaults to a generated name.
- *
- * @since 5.1.0
- */
- String mappingContextBeanName() default GENERATE_BEAN_NAME;
-
- /**
- * Configures whether nested repository-interfaces (e.g. defined as inner classes) should be discovered by the
- * repositories infrastructure.
- */
- boolean considerNestedRepositories() default false;
-
- /**
- * Configures whether to enable default transactions for Spring Data Neo4j repositories. Defaults to {@literal true}.
- * If disabled, repositories must be used behind a facade that's configuring transactions (e.g. using Spring's
- * annotation driven transaction facilities) or repository methods have to be used to demarcate transactions.
- *
- * @return whether to enable default transactions, defaults to {@literal true}.
- */
- boolean enableDefaultTransactions() default true;
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jAuditingEventListener.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jAuditingEventListener.java
deleted file mode 100644
index 3356b5cea..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jAuditingEventListener.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.config;
-
-import org.neo4j.ogm.session.SessionFactory;
-import org.neo4j.ogm.session.event.Event;
-import org.neo4j.ogm.session.event.EventListener;
-import org.neo4j.ogm.session.event.EventListenerAdapter;
-import org.springframework.beans.factory.ObjectFactory;
-import org.springframework.data.auditing.AuditingHandler;
-import org.springframework.data.auditing.IsNewAwareAuditingHandler;
-import org.springframework.data.mapping.context.MappingContext;
-import org.springframework.data.neo4j.repository.support.Neo4jAuditingBeanPostProcessor;
-import org.springframework.util.Assert;
-
-/**
- * @author Frantisek Hartman
- */
-public class Neo4jAuditingEventListener extends EventListenerAdapter implements EventListener {
-
- private final ObjectFactory extends IsNewAwareAuditingHandler> auditingHandlerFactory;
-
- /**
- * Creates a new {@link Neo4jAuditingEventListener} using the given {@link MappingContext} and {@link AuditingHandler}
- * provided by the given {@link ObjectFactory}. This constructor does an additional registration to the
- * {@link SessionFactory}. Therefore the {@link SessionFactory} must already be instantiated.
- *
- * @deprecated this constructor could create a cyclic dependency to the session factory if this class gets registered
- * as a bean in the context.
- * @param auditingHandlerFactory must not be {@literal null}.
- */
- @Deprecated
- public Neo4jAuditingEventListener(ObjectFactory extends IsNewAwareAuditingHandler> auditingHandlerFactory,
- SessionFactory sessionFactory) {
-
- Assert.notNull(auditingHandlerFactory, "IsNewAwareAuditingHandler must not be null!");
- this.auditingHandlerFactory = auditingHandlerFactory;
-
- sessionFactory.register(this);
- }
-
- /**
- * Constructor used for creating an instance in the {@link Neo4jAuditingRegistrar} to get registered in the session
- * "manually". The registration is done within the {@link Neo4jAuditingBeanPostProcessor}.
- *
- * @param auditingHandlerFactory {@link AuditingHandler} to hook into the {@code preSave} phase for auditing.
- */
- public Neo4jAuditingEventListener(ObjectFactory extends IsNewAwareAuditingHandler> auditingHandlerFactory) {
- Assert.notNull(auditingHandlerFactory, "IsNewAwareAuditingHandler must not be null!");
- this.auditingHandlerFactory = auditingHandlerFactory;
- }
-
- @Override
- public void onPreSave(Event event) {
- Object object = event.getObject();
- if (object != null) {
- auditingHandlerFactory.getObject().markAudited(object);
- }
- }
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jAuditingRegistrar.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jAuditingRegistrar.java
deleted file mode 100644
index e71bc52e8..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jAuditingRegistrar.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.config;
-
-import java.lang.annotation.Annotation;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.data.auditing.IsNewAwareAuditingHandler;
-import org.springframework.data.auditing.config.AuditingBeanDefinitionRegistrarSupport;
-import org.springframework.data.auditing.config.AuditingConfiguration;
-import org.springframework.data.config.ParsingUtils;
-import org.springframework.data.mapping.context.PersistentEntities;
-import org.springframework.data.neo4j.annotation.EnableNeo4jAuditing;
-import org.springframework.data.neo4j.repository.support.Neo4jAuditingBeanPostProcessor;
-import org.springframework.util.Assert;
-
-/**
- * @author Frantisek Hartman
- */
-public class Neo4jAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
-
- @Override
- protected Class extends Annotation> getAnnotation() {
- return EnableNeo4jAuditing.class;
- }
-
- @Override
- protected String getAuditingHandlerBeanName() {
- return "neo4jAuditingHandler";
- }
-
- @Override
- protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
-
- Assert.notNull(configuration, "AuditingConfiguration must not be null!");
-
- BeanDefinitionBuilder handler = BeanDefinitionBuilder.rootBeanDefinition(IsNewAwareAuditingHandler.class);
-
- BeanDefinitionBuilder definition = BeanDefinitionBuilder
- .genericBeanDefinition(Neo4jMappingContextFactoryBean.class);
- definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_CONSTRUCTOR);
-
- BeanDefinitionBuilder entities = BeanDefinitionBuilder.rootBeanDefinition(PersistentEntities.class);
- entities.addConstructorArgValue(definition);
-
- handler.addConstructorArgValue(definition.getBeanDefinition());
- return configureDefaultAuditHandlerAttributes(configuration, handler);
- }
-
- @Override
- protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition,
- BeanDefinitionRegistry registry) {
-
- Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null!");
- Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
-
- BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder
- .rootBeanDefinition(Neo4jAuditingBeanPostProcessor.class);
-
- beanDefinitionBuilder
- .addConstructorArgValue(ParsingUtils.getObjectFactoryBeanDefinition(getAuditingHandlerBeanName(), registry));
-
- registerInfrastructureBeanWithId(beanDefinitionBuilder.getBeanDefinition(),
- Neo4jAuditingBeanPostProcessor.class.getName(), registry);
- }
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jMappingContextFactoryBean.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jMappingContextFactoryBean.java
deleted file mode 100644
index e8bf3e681..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jMappingContextFactoryBean.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.config;
-
-import org.neo4j.ogm.session.SessionFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.FactoryBean;
-import org.springframework.beans.factory.ListableBeanFactory;
-import org.springframework.beans.factory.config.AbstractFactoryBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.data.neo4j.mapping.Neo4jMappingContext;
-import org.springframework.util.Assert;
-
-/**
- * {@link FactoryBean} to setup {@link Neo4jMappingContext} instances from Spring configuration.
- *
- * @author Mark Angrish
- * @author Nicolas Mervaillie
- * @author Michael J. Simons
- */
-public class Neo4jMappingContextFactoryBean extends AbstractFactoryBean
- implements ApplicationContextAware {
-
- private final String sessionFactoryBeanName;
-
- private ListableBeanFactory beanFactory;
-
- /**
- * Uses the default session factory name
- * {@link Neo4jRepositoryConfigurationExtension#DEFAULT_SESSION_FACTORY_BEAN_NAME} for finding the session factory
- * passed to the {@link Neo4jMappingContext}.
- *
- * @deprecated since 5.1.0, use {@link #Neo4jMappingContextFactoryBean(String)} instead
- */
- @Deprecated
- public Neo4jMappingContextFactoryBean() {
- this(Neo4jRepositoryConfigurationExtension.DEFAULT_SESSION_FACTORY_BEAN_NAME);
- }
-
- /**
- * Configures the mapping context with a named {@link SessionFactory}.
- *
- * @param sessionFactoryBeanName must not be {@literal null} or empty.
- * @since 5.1.0
- */
- public Neo4jMappingContextFactoryBean(String sessionFactoryBeanName) {
-
- Assert.hasText(sessionFactoryBeanName, "SessionFactoryBeanName must not be null or empty!");
-
- this.sessionFactoryBeanName = sessionFactoryBeanName;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
- */
- @Override
- public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
- this.beanFactory = applicationContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.beans.factory.config.AbstractFactoryBean#getObjectType()
- */
- @Override
- public Class> getObjectType() {
- return Neo4jMappingContext.class;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.beans.factory.config.AbstractFactoryBean#createInstance()
- */
- @Override
- protected Neo4jMappingContext createInstance() {
-
- SessionFactory sessionFactory = beanFactory.getBean(this.sessionFactoryBeanName, SessionFactory.class);
- Neo4jMappingContext context = new Neo4jMappingContext(sessionFactory.metaData());
-
- context.initialize();
-
- return context;
- }
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jOgmEntityInstantiatorConfigurationBean.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jOgmEntityInstantiatorConfigurationBean.java
deleted file mode 100644
index 7aa677290..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jOgmEntityInstantiatorConfigurationBean.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.config;
-
-import org.neo4j.ogm.metadata.MetaData;
-import org.neo4j.ogm.session.SessionFactory;
-import org.neo4j.ogm.typeconversion.ConversionCallback;
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.core.convert.ConversionService;
-import org.springframework.data.neo4j.conversion.MetaDataDrivenConversionService;
-import org.springframework.data.neo4j.conversion.Neo4jOgmEntityInstantiatorAdapter;
-import org.springframework.data.neo4j.mapping.Neo4jMappingContext;
-
-/**
- *
- * @author Gerrit Meier
- * @author Michael J. Simons
- */
-class Neo4jOgmEntityInstantiatorConfigurationBean {
-
- public Neo4jOgmEntityInstantiatorConfigurationBean(SessionFactory sessionFactory, Neo4jMappingContext mappingContext,
- ObjectProvider conversionServiceObjectProvider) {
-
- MetaData metaData = sessionFactory.metaData();
- ConversionService conversionService = conversionServiceObjectProvider
- .getIfUnique(() -> new MetaDataDrivenConversionService(metaData));
- metaData.registerConversionCallback(new ConversionServiceBasedConversionCallback(conversionService));
-
- sessionFactory.setEntityInstantiator(new Neo4jOgmEntityInstantiatorAdapter(mappingContext, conversionService));
- }
-
- private static class ConversionServiceBasedConversionCallback implements ConversionCallback {
-
- private final ConversionService delegate;
-
- public ConversionServiceBasedConversionCallback(ConversionService conversionService) {
- this.delegate = conversionService;
- }
-
- @Override
- public T convert(Class targetType, Object value) {
- if (value == null) {
- return null;
- }
- return delegate.convert(value, targetType);
- }
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoriesRegistrar.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoriesRegistrar.java
deleted file mode 100644
index ec1368cf1..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoriesRegistrar.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.config;
-
-import java.lang.annotation.Annotation;
-
-import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport;
-import org.springframework.data.repository.config.RepositoryConfigurationExtension;
-
-/**
- * @author Vince Bickers
- * @author Mark Angrish
- */
-public class Neo4jRepositoriesRegistrar extends RepositoryBeanDefinitionRegistrarSupport {
-
- @Override
- protected Class extends Annotation> getAnnotation() {
- return EnableNeo4jRepositories.class;
- }
-
- @Override
- protected RepositoryConfigurationExtension getExtension() {
- return new Neo4jRepositoryConfigurationExtension();
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoryConfigurationExtension.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoryConfigurationExtension.java
deleted file mode 100644
index 93e94f68d..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoryConfigurationExtension.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.config;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Optional;
-
-import org.neo4j.ogm.annotation.NodeEntity;
-import org.neo4j.ogm.annotation.RelationshipEntity;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.AutowireCandidateQualifier;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.beans.factory.support.RootBeanDefinition;
-import org.springframework.core.annotation.AnnotationAttributes;
-import org.springframework.dao.DataAccessException;
-import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
-import org.springframework.data.neo4j.repository.Neo4jRepository;
-import org.springframework.data.neo4j.repository.support.Neo4jPersistenceExceptionTranslator;
-import org.springframework.data.neo4j.repository.support.Neo4jRepositoryFactoryBean;
-import org.springframework.data.neo4j.transaction.SharedSessionCreator;
-import org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource;
-import org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport;
-import org.springframework.data.repository.config.RepositoryConfigurationSource;
-import org.springframework.data.repository.config.XmlRepositoryConfigurationSource;
-import org.springframework.util.ClassUtils;
-import org.springframework.util.StringUtils;
-
-/**
- * Neo4j specific configuration extension parsing custom attributes from the XML namespace and
- * {@link EnableNeo4jRepositories} annotation. Creates and registers {@link BeanDefinitionBuilder} for
- * {@link SharedSessionCreator} and {@link Neo4jMappingContextFactoryBean}. Also, it registers a bean definition for a
- * {@link PersistenceExceptionTranslationPostProcessor} to enable exception translation of persistence specific
- * exceptions into Spring's {@link DataAccessException} hierarchy.
- *
- * @author Vince Bickers
- * @author Mark Angrish
- * @author Mark Paluch
- * @author Gerrit Meier
- * @author Michael J. Simons
- */
-public class Neo4jRepositoryConfigurationExtension extends RepositoryConfigurationExtensionSupport {
-
- /** See {@link AbstractBeanDefinition#INFER_METHOD}. */
- static final String GENERATE_BEAN_NAME = "(generated)";
- static final String DEFAULT_SESSION_FACTORY_BEAN_NAME = "sessionFactory";
- static final String DEFAULT_TRANSACTION_MANAGER_BEAN_NAME = "transactionManager";
-
- private static final String ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE = "enableDefaultTransactions";
- private static final String NEO4J_PERSISTENCE_EXCEPTION_TRANSLATOR_NAME = "neo4jPersistenceExceptionTranslator";
- private static final String MODULE_PREFIX = "neo4j";
- private static final String MODULE_NAME = "Neo4j";
-
- /**
- * We use a generated name for every pair of {@code SessionFactory} and {@code Session} unless the user configures a
- * session bean name with {@code @EnableNeo4jRepositories(sessionBeanName="someName")}.
- */
- private String sessionBeanName;
-
- /**
- * We use a generated name for every pair of {@code SessionFactory} and {@code Neo4jMappingContext} unless the user
- * configures a session bean name with {@code @EnableNeo4jRepositories(mappingContextBeanName="someName")}.
- */
- private String neo4jMappingContextBeanName;
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#getModuleName()
- */
- @Override
- public String getModuleName() {
- return MODULE_NAME;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config14.RepositoryConfigurationExtension#getRepositoryFactoryBeanClassName()
- */
- @Override
- public String getRepositoryFactoryBeanClassName() {
- return Neo4jRepositoryFactoryBean.class.getName();
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config14.RepositoryConfigurationExtensionSupport#getModulePrefix()
- */
- @Override
- protected String getModulePrefix() {
- return MODULE_PREFIX;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#getIdentifyingAnnotations()
- */
- @Override
- @SuppressWarnings("unchecked")
- protected Collection> getIdentifyingAnnotations() {
- return Arrays.asList(NodeEntity.class, RelationshipEntity.class);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#getIdentifyingTypes()
- */
- @Override
- protected Collection> getIdentifyingTypes() {
- return Collections.> singleton(Neo4jRepository.class);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder, org.springframework.data.repository.config.RepositoryConfigurationSource)
- */
- @Override
- public void postProcess(BeanDefinitionBuilder builder, RepositoryConfigurationSource source) {
-
- String transactionManagerRefPropertyName = "transactionManagerRef";
- String transactionManagerPropertyName = "transactionManager";
- String mappingContextPropertyName = "mappingContext";
- String sessionPropertyName = "session";
-
- Optional transactionManagerRef = source.getAttribute(transactionManagerRefPropertyName);
- builder.addPropertyValue(transactionManagerPropertyName,
- transactionManagerRef.orElse(DEFAULT_TRANSACTION_MANAGER_BEAN_NAME));
-
- builder.addPropertyReference(sessionPropertyName, this.sessionBeanName);
- builder.addPropertyReference(mappingContextPropertyName, this.neo4jMappingContextBeanName);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder, org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource)
- */
- @Override
- public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
-
- AnnotationAttributes attributes = config.getAttributes();
-
- builder.addPropertyValue(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE,
- attributes.getBoolean(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE));
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder, org.springframework.data.repository.config.XmlRepositoryConfigurationSource)
- */
- @Override
- public void postProcess(BeanDefinitionBuilder builder, XmlRepositoryConfigurationSource config) {
-
- Optional enableDefaultTransactions = config.getAttribute(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE);
-
- if (enableDefaultTransactions.filter(StringUtils::hasText).isPresent()) {
- enableDefaultTransactions
- .ifPresent(value -> builder.addPropertyValue(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE, value));
-
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#registerBeansForRoot(org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.data.repository.config.RepositoryConfigurationSource)
- */
- @Override
- public void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConfigurationSource config) {
-
- super.registerBeansForRoot(registry, config);
-
- Object source = config.getSource();
- if (source == null) {
- return;
- }
-
- String configuredSessionBeanName = config.getAttribute("sessionBeanName").orElse(GENERATE_BEAN_NAME);
- this.sessionBeanName = registerWithGeneratedNameOrUseConfigured(createSharedSessionCreatorBeanDefinition(config),
- registry, configuredSessionBeanName, source);
-
- String configuredMappingContextBeanName = config.getAttribute("mappingContextBeanName").orElse(GENERATE_BEAN_NAME);
- this.neo4jMappingContextBeanName = registerWithGeneratedNameOrUseConfigured(
- createNeo4jMappingContextFactoryBeanDefinition(config), registry, configuredMappingContextBeanName, source);
-
- registerIfNotAlreadyRegistered(() -> new RootBeanDefinition(Neo4jPersistenceExceptionTranslator.class), registry,
- NEO4J_PERSISTENCE_EXCEPTION_TRANSLATOR_NAME, source);
-
- AbstractBeanDefinition rootBeanDefinition = BeanDefinitionBuilder
- .rootBeanDefinition(Neo4jOgmEntityInstantiatorConfigurationBean.class)
- .setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE)
- .addConstructorArgReference(getSessionFactoryBeanName(config))
- .addConstructorArgReference(this.neo4jMappingContextBeanName).getBeanDefinition();
- registerWithGeneratedNameOrUseConfigured(rootBeanDefinition, registry, GENERATE_BEAN_NAME, source);
- }
-
- /**
- * Uses a generated bean name if {@code configuredBeanName} is equal to {@link #GENERATE_BEAN_NAME}, otherwise uses
- * the configured bean name to register the new bean. Does not check if there's already a bean under the configured
- * name but throws a {@link org.springframework.beans.factory.BeanDefinitionStoreException}. Checks whether a bean is
- * already registered under {@code configuredBeanName} in the given {@link BeanDefinitionRegistry} and uses a
- * generated name for registering the bean instead. If not, the suggested bean name is used.
- *
- * @param bean must not be {@literal null}.
- * @param registry must not be {@literal null}.
- * @param configuredBeanName must not be {@literal null} or empty.
- * @param source must not be {@literal null}.
- * @throws org.springframework.beans.factory.BeanDefinitionStoreException if the BeanDefinition is invalid or if there
- * is already a BeanDefinition for the specified bean name * (and we are not allowed to override it)
- * @return the bean name used for registering the given {@link AbstractBeanDefinition}
- */
- private static String registerWithGeneratedNameOrUseConfigured(AbstractBeanDefinition bean,
- BeanDefinitionRegistry registry, String configuredBeanName, Object source) {
-
- String registeredBeanName = configuredBeanName;
- if (GENERATE_BEAN_NAME.equals(configuredBeanName)) {
- registeredBeanName = registerWithSourceAndGeneratedBeanName(bean, registry, source);
- } else {
- bean.setSource(source);
- registry.registerBeanDefinition(configuredBeanName, bean);
- }
- return registeredBeanName;
- }
-
- private static AbstractBeanDefinition createSharedSessionCreatorBeanDefinition(RepositoryConfigurationSource config) {
-
- String sessionFactoryBeanName = getSessionFactoryBeanName(config);
-
- AbstractBeanDefinition sharedSessionCreatorBeanDefinition = BeanDefinitionBuilder //
- .rootBeanDefinition(SharedSessionCreator.class, "createSharedSession") //
- .addConstructorArgReference(sessionFactoryBeanName) //
- .getBeanDefinition();
-
- sharedSessionCreatorBeanDefinition
- .addQualifier(new AutowireCandidateQualifier(Qualifier.class, sessionFactoryBeanName));
-
- return sharedSessionCreatorBeanDefinition;
- }
-
- private static AbstractBeanDefinition createNeo4jMappingContextFactoryBeanDefinition(
- RepositoryConfigurationSource config) {
-
- return BeanDefinitionBuilder //
- .rootBeanDefinition(Neo4jMappingContextFactoryBean.class) //
- .addConstructorArgValue(getSessionFactoryBeanName(config)) //
- .getBeanDefinition();
- }
-
- private static String getSessionFactoryBeanName(RepositoryConfigurationSource config) {
- return Optional.of("sessionFactoryRef").flatMap(config::getAttribute).orElse(DEFAULT_SESSION_FACTORY_BEAN_NAME);
- }
-
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoryNameSpaceHandler.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoryNameSpaceHandler.java
deleted file mode 100644
index ebc5c0170..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoryNameSpaceHandler.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.config;
-
-import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
-import org.springframework.data.repository.config.RepositoryBeanDefinitionParser;
-import org.springframework.data.repository.config.RepositoryConfigurationExtension;
-
-/**
- * Simple namespace handler for {@literal repositories} namespace.
- *
- * @author Mark Angrish
- */
-public class Neo4jRepositoryNameSpaceHandler extends NamespaceHandlerSupport {
-
- /*
- * (non-Javadoc)
- *
- * @see org.springframework.beans.factory.xml.NamespaceHandler#init()
- */
- public void init() {
-
- RepositoryConfigurationExtension extension = new Neo4jRepositoryConfigurationExtension();
- RepositoryBeanDefinitionParser repositoryBeanDefinitionParser = new RepositoryBeanDefinitionParser(extension);
-
- registerBeanDefinitionParser("repositories", repositoryBeanDefinitionParser);
- }
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/package-info.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/package-info.java
deleted file mode 100644
index e81c2bbfd..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Infrastructure for Neo4j specific repositories.
- */
-package org.springframework.data.neo4j.repository;
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/AbstractGraphRepositoryQuery.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/AbstractGraphRepositoryQuery.java
deleted file mode 100644
index 833d2221b..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/AbstractGraphRepositoryQuery.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.query;
-
-import java.util.EmptyStackException;
-
-import org.neo4j.ogm.metadata.MetaData;
-import org.neo4j.ogm.model.QueryStatistics;
-import org.neo4j.ogm.model.Result;
-import org.neo4j.ogm.session.Session;
-import org.springframework.data.repository.query.RepositoryQuery;
-
-/**
- * Base class for @link {@link RepositoryQuery}s.
- *
- * @author Nicolas Mervaillie
- * @author Michael J. Simons
- */
-public abstract class AbstractGraphRepositoryQuery implements RepositoryQuery {
-
- protected final GraphQueryMethod queryMethod;
- protected final MetaData metaData;
- protected final Session session;
-
- protected AbstractGraphRepositoryQuery(GraphQueryMethod queryMethod, MetaData metaData, Session session) {
-
- this.queryMethod = queryMethod;
- this.metaData = metaData;
- this.session = session;
- }
-
- protected abstract Query getQuery(Object[] parameters);
-
- @Override
- public Object execute(Object[] parameters) {
-
- Query query;
- try {
- query = getQuery(parameters);
- } catch (EmptyStackException e) {
- throw new IllegalArgumentException("Not enough arguments for query " + getQueryMethod().getName());
- }
-
- return doExecute(query, parameters);
- }
-
- protected abstract Object doExecute(Query params, Object[] parameters);
-
- @Override
- public GraphQueryMethod getQueryMethod() {
- return queryMethod;
- }
-
- protected GraphQueryExecution getExecution(GraphParameterAccessor accessor) {
-
- if (queryMethod.isStreamQuery()) {
- return new GraphQueryExecution.CollectionExecution(session, accessor);
- }
- if (isCountQuery()) {
- return new GraphQueryExecution.CountByExecution(session);
- }
- if (isDeleteQuery()) {
- return new GraphQueryExecution.DeleteByExecution(session, queryMethod);
- }
- if (isExistsQuery()) {
- return new GraphQueryExecution.ExistsByExecution(session);
- }
- if (returnsOgmSpecificType()) {
- return new GraphQueryExecution.QueryResultExecution(session, accessor);
- }
- if (queryMethod.isCollectionQuery()) {
- return new GraphQueryExecution.CollectionExecution(session, accessor);
- }
- if (queryMethod.isPageQuery()) {
- return new GraphQueryExecution.PagedExecution(session, accessor);
- }
- if (queryMethod.isSliceQuery()) {
- return new GraphQueryExecution.SlicedExecution(session, accessor);
- }
- return new GraphQueryExecution.SingleEntityExecution(session, accessor);
- }
-
- /**
- * Does the query returns an OGM specific object type that should get a special processing ?
- *
- * @return true if that's the case
- */
- private boolean returnsOgmSpecificType() {
- Class returnType = queryMethod.getMethod().getReturnType();
- return QueryStatistics.class.isAssignableFrom(returnType) || Result.class.isAssignableFrom(returnType);
- }
-
- /**
- * Returns whether the query should get a count projection applied.
- *
- * @return
- */
- protected abstract boolean isCountQuery();
-
- /**
- * Returns whether the query should get an exists projection applied.
- *
- * @return
- */
- protected abstract boolean isExistsQuery();
-
- /**
- * Return weather the query should delete matching documents.
- *
- * @return
- */
- protected abstract boolean isDeleteQuery();
-}
diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/CustomResultConverter.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/CustomResultConverter.java
deleted file mode 100644
index 4e2a3ffef..000000000
--- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/CustomResultConverter.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2011-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.neo4j.repository.query;
-
-import static java.lang.reflect.Proxy.*;
-
-import java.util.Map;
-
-import org.neo4j.ogm.context.SingleUseEntityMapper;
-import org.neo4j.ogm.metadata.MetaData;
-import org.springframework.core.convert.converter.Converter;
-import org.springframework.data.neo4j.annotation.QueryResult;
-
-/**
- * Convert OGM special {@link QueryResult} annotated types into SD understandable type.
- *
- * @author Nicolas Mervaillie
- * @author Gerrit Meier
- * @author Michael J. Simons
- */
-class CustomResultConverter implements Converter