# Possibility to use projections in RelationshipProperties?

**URL:** <https://community.neo4j.com/t/possibility-to-use-projections-in-relationshipproperties/43016>\
**Category:** Spring Data Neo4j & Neo4j-OGM\
**Created:** [August 17, 2021, 7:28am UTC](https://community.neo4j.com/t/possibility-to-use-projections-in-relationshipproperties/43016 "2021-08-17T07:28:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![torben.bock](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/torben.bock/32/4610_2.png) [@torben.bock](https://community.neo4j.com/u/torben.bock)\
**Post date:** [August 17, 2021, 7:28am UTC](https://community.neo4j.com/t/possibility-to-use-projections-in-relationshipproperties/43016/1 "2021-08-17T07:28:46Z")

</div>

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**

 ![entities](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/6/7/67584114a8bd944d7a71e84453ba6d4b7c1e1209.jpeg)

**Persistence Logic**

 ![repo2](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/8/b/8b357690868d73f3fafb37f4789a44caa38dfc88.jpeg)

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?

---

<div class="post-metadata">

**Author:** ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)\
**Post date:** [August 19, 2021, 8:35pm UTC](https://community.neo4j.com/t/possibility-to-use-projections-in-relationshipproperties/43016/2 "2021-08-19T20:35:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![torben.bock](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/torben.bock/32/4610_2.png) [@torben.bock](https://community.neo4j.com/u/torben.bock)\
**Post date:** [August 27, 2021, 9:54am UTC](https://community.neo4j.com/t/possibility-to-use-projections-in-relationshipproperties/43016/3 "2021-08-27T09:54:25Z")

</div>

An example can be downloaded [here](https://prodynaagger-my.sharepoint.com/:u:/g/personal/torben_bock_prodyna_com/EQtRRuRVTm9FtNN0NaNe72wBc9vWxrxoSlwrBZiSVtlC4Q?e=FtkGDF). I've tried to explain it within the PartnerPersistenceRepositoryTest class.
