Given I have two entity: Person and Company, and there are multiple relationships between them:
Person - Company:
- The person can be the employee of the company
- The person can be the shareholder of the company
- The person can be the legal person of the company
Company - Company:
- The company can be the legal of the company
- The company can be the shareholder of the company
So how to modeling this in spring data neo4j?
What I tried is make 3 relationship types: EMPLOY, INVEST, LEGAL, each relationship type with the Company as the StartNode and the person as the EndNode, then in company and person, keep these relationships with the "UNDIRECTED" direction, just same as the diagram present, but always get the stackoverflow error when saving and searching.