cancel
Showing results for 
Search instead for 
Did you mean: 

Possibility to use projections in RelationshipProperties?

We started to use SDN 6.1.3 and facing some challenges to understand how we have to adapt our persistence layer to persist our current model without loading the whole graph every time.

(:Partner) -[:HAS_STATE {knowlegeTime: LocalDateTime}]-> (:State) -[:HAS_PARENT {validFrom, validTo: LocalDateTime}]-> (:Partner)

From an external system we receive update messages representing one state of partner:

kin, parentRef, knowledgeTime, validFrom, validTo

Entities

Persistence Logic

Our Aggregate represents a Partner with it's various states and potential parent relationships to other partners. In our persistence layer i would prefer to have an explicit HAS_PARENT relationship instead of using the identifiers in properties of the other aggregates.

Is there any possibility to explicitly model (Rich)Relationships to use Projections as a TargetNode to prevent update / fetching other aggregates when using the Neo4jRepositories and if yes could you provide us an example?

2 REPLIES 2

It would be great if you could condense your issue into a small reproducible example with a test and share the code. Thank you!

An example can be downloaded here. I've tried to explain it within the PartnerPersistenceRepositoryTest class.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.