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


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?

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

1 Like

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