Warm tip: This article is reproduced from serverfault.com, please click

@CompositeProperty annotation for reactive neo4j implementation

发布于 2022-03-04 17:23:31

I want to experiment on neo4j reactive implementation from an existing spring-boot project using neo4j. while migrating to Reactive neo4j implementation, I'm missing the CompositeProperty for the dynamic properties. Is @CompositeProperty supported? or would it be in the future implementation?

Please suggest how to resolve this.

I tried with following dependency.

<dependency>
    <groupId>org.neo4j.springframework.data</groupId>
    <artifactId>spring-data-neo4j-rx-spring-boot-starter</artifactId>
    <version>1.1.1</version>
</dependency>
Questioner
chandra mohan
Viewed
0
meistermeier 2022-03-05 19:02:21

You should not use Spring Data Neo4j R/X anymore. It was a WIP project that eventually finds its destination as the successor of Spring Data Neo4j 5.x (and before). With a recent Spring Boot release (starting with 2.4), you will get the completely rewritten Spring Data Neo4j if you add the Spring Data Neo4j Boot starter to your dependencies:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-neo4j</artifactId>
</dependency>

And yes, it has @CompositeProperties (https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#custom.conversions.composite-properties)

@Node
public class Entity {
    // id etc.

    @CompositeProperty
    private Map<String, String> additionalFields = new HashMap<>();
}

It supports prefix, converter, and even converterRef(erences) to bean instances.