# Neo4j-OGM's RelationshipEntity in Spring Data Neo4j 6

**URL:** <https://community.neo4j.com/t/neo4j-ogms-relationshipentity-in-spring-data-neo4j-6/43423>\
**Category:** Spring Data Neo4j & Neo4j-OGM\
**Tags:** spring\
**Created:** [August 24, 2021, 12:17pm UTC](https://community.neo4j.com/t/neo4j-ogms-relationshipentity-in-spring-data-neo4j-6/43423 "2021-08-24T12:17:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![corneil.duplessis](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/corneil.duplessis/32/3452_2.png) [@corneil.duplessis](https://community.neo4j.com/u/corneil.duplessis)\
**Post date:** [August 24, 2021, 12:17pm UTC](https://community.neo4j.com/t/neo4j-ogms-relationshipentity-in-spring-data-neo4j-6/43423/1 "2021-08-24T12:17:29Z")

</div>

I really believe this position should be reconsidered.  
If I want to do the following as an example.  
I have something like Skill as a node.  
This can be linked to many other things like Course, Job, Person  
I don't need the models or Course or Job or Person to be aware of the relationship with Skill. and I don't want Skill to be modified when a new kind of relationship is added. I want to manipulate those relationships by themselves like I could with OGM and RelationshipEntity. By forcing ownership I am now forced to load the relationship or use projections to avoid loading the relationship and forced update the class with @Node as the owner of the relationship when adding a new kind of relationship.  
With RelationshipEntity I had a way of adding and querying a relationship without updating the NodeEntity until I decided I wanted that relationship as part NodeEntity.  
With SDN 6 I cannot manipulate arbitrary relationships. I have to go to CypherDSL or Neo4J OGM or core Neo4J API.  
I always thought that Nodes and Relationships have the same value and standing.

This approach turns Neo4J into a Document database.

If there is something I am misunderstanding I am open to being shown the error of my ways.

---

<div class="post-metadata">

**Author:** ![gerrit.meier](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/gerrit.meier/32/27374_2.png) [@gerrit.meier](https://community.neo4j.com/u/gerrit.meier)\
**Post date:** [August 25, 2021, 1:53pm UTC](https://community.neo4j.com/t/neo4j-ogms-relationshipentity-in-spring-data-neo4j-6/43423/2 "2021-08-25T13:53:56Z")

</div>

Picture me surprise: You mean that you never before attached a `@RelationshipEntity` to a `@NodeEntity`?  
And you are right: If you want to just pick and edit a relationship that is not owned by a node you have to go the manual route. Either be it SDN's `Neo4jClient` or the Java driver directly.

Why we did it this way (and it probably won't change in the future):  
Also in Neo4j itself a relationship cannot live on it's own. There always needs to be a start and an end node. Bringing this into our object model world, the relationship is the natural connection between different nodes.  
This is for me a very similar concept like the well known mapping tables in the relational database world. Also something you would not regularly fetch from the database with a ORM.

What would be interesting for me: Why would you avoid the ownership at all cost?

---

<div class="post-metadata">

**Author:** ![corneil.duplessis](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/corneil.duplessis/32/3452_2.png) [@corneil.duplessis](https://community.neo4j.com/u/corneil.duplessis)\
**Post date:** [August 25, 2021, 3:21pm UTC](https://community.neo4j.com/t/neo4j-ogms-relationshipentity-in-spring-data-neo4j-6/43423/3 "2021-08-25T15:21:50Z")

</div>

In most cases, I have @NodeEntity the owns the @Relationship.

There are cases where I will end up loading far too much data if I model the relationship via ownership in a @NodeEntity. In those cases, I like being able to model and manipulate the @RelationshipEntity.  
That option is now gone. This means that a part of the model cannot be expressed like the rest of the model, I have to document it separately and manipulate it via CyperDSL or Direct API.
