Skip to content

Commit 3ef2065

Browse files
GH-2133 - Remove o.s.d.annotation.Persistent from the set of identifying annotations.
This removes `@Persistent` from the set that is used as so called identifying annotations inside the repository configuration. This change makes the process of identifying a repository as Neo4j repository more strict: While it doesn't change anything in a single store scenario - repository is selected by the entity being managed and that is still `@Persistent` - it will fix missidentifying a repository of another store as elligable for being a Neo4j repository. This fixes #2133.
1 parent cc73484 commit 3ef2065

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/main/java/org/springframework/data/neo4j/core/schema/Node.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import org.apiguardian.api.API;
2525
import org.springframework.core.annotation.AliasFor;
26+
import org.springframework.data.annotation.Persistent;
2627

2728
/**
2829
* The annotation to configure the mapping from a node with a given set of labels to a class and vice versa.
@@ -33,7 +34,7 @@
3334
@Retention(RetentionPolicy.RUNTIME)
3435
@Target(ElementType.TYPE)
3536
@Documented
36-
@org.springframework.data.annotation.Persistent
37+
@Persistent
3738
@API(status = API.Status.STABLE, since = "6.0")
3839
public @interface Node {
3940

src/main/java/org/springframework/data/neo4j/repository/config/Neo4jRepositoryConfigurationExtension.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.springframework.beans.factory.support.AbstractBeanDefinition;
2626
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
2727
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
28-
import org.springframework.data.annotation.Persistent;
2928
import org.springframework.data.neo4j.core.schema.Node;
3029
import org.springframework.data.neo4j.core.schema.RelationshipProperties;
3130
import org.springframework.data.neo4j.repository.Neo4jRepository;
@@ -71,7 +70,7 @@ public Neo4jRepositoryConfigurationExtension() {
7170

7271
/*
7372
* (non-Javadoc)
74-
* @see org.springframework.data.repository.config14.RepositoryConfigurationExtension#getRepositoryFactoryBeanClassName()
73+
* @see org.springframework.data.repository.config.RepositoryConfigurationExtension#getRepositoryFactoryBeanClassName()
7574
*/
7675
@Override
7776
public String getRepositoryFactoryBeanClassName() {
@@ -80,7 +79,7 @@ public String getRepositoryFactoryBeanClassName() {
8079

8180
/*
8281
* (non-Javadoc)
83-
* @see org.springframework.data.repository.config14.RepositoryConfigurationExtensionSupport#getModulePrefix()
82+
* @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#getModulePrefix()
8483
*/
8584
@Override
8685
protected String getModulePrefix() {
@@ -89,7 +88,7 @@ protected String getModulePrefix() {
8988

9089
@Override
9190
protected Collection<Class<? extends Annotation>> getIdentifyingAnnotations() {
92-
return Arrays.asList(Node.class, RelationshipProperties.class, Persistent.class);
91+
return Arrays.asList(Node.class, RelationshipProperties.class);
9392
}
9493

9594
@Override

src/main/java/org/springframework/data/neo4j/repository/config/ReactiveNeo4jRepositoryConfigurationExtension.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.springframework.beans.factory.support.AbstractBeanDefinition;
2626
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
2727
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
28-
import org.springframework.data.annotation.Persistent;
2928
import org.springframework.data.neo4j.core.schema.Node;
3029
import org.springframework.data.neo4j.core.schema.RelationshipProperties;
3130
import org.springframework.data.neo4j.repository.ReactiveNeo4jRepository;
@@ -71,7 +70,7 @@ public ReactiveNeo4jRepositoryConfigurationExtension() {
7170

7271
/*
7372
* (non-Javadoc)
74-
* @see org.springframework.data.repository.config14.RepositoryConfigurationExtension#getRepositoryFactoryBeanClassName()
73+
* @see org.springframework.data.repository.config.RepositoryConfigurationExtension#getRepositoryFactoryBeanClassName()
7574
*/
7675
@Override
7776
public String getRepositoryFactoryBeanClassName() {
@@ -80,7 +79,7 @@ public String getRepositoryFactoryBeanClassName() {
8079

8180
/*
8281
* (non-Javadoc)
83-
* @see org.springframework.data.repository.config14.RepositoryConfigurationExtensionSupport#getModulePrefix()
82+
* @see org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport#getModulePrefix()
8483
*/
8584
@Override
8685
protected String getModulePrefix() {
@@ -89,7 +88,7 @@ protected String getModulePrefix() {
8988

9089
@Override
9190
protected Collection<Class<? extends Annotation>> getIdentifyingAnnotations() {
92-
return Arrays.asList(Node.class, RelationshipProperties.class, Persistent.class);
91+
return Arrays.asList(Node.class, RelationshipProperties.class);
9392
}
9493

9594
@Override

0 commit comments

Comments
 (0)