I am currently working on an enterprise-architecture-management-system for my bachelor thesis in a insurance company. The company wants to display all self-made applications (Application-Node) in a Neo4J-Graphdatabase with Webservice-dependencies as relationships. Alongside the applications, the company also wants to persist the [Maven] versions (Version-Node) of an application (HAS_VERSION-Relationship), because new versions can have new dependencies or lose old ones (USES-Relationship). And here is my point. I want to provide unique Version-subnodes for each application instance. Such as:
APPLICATION Foo HAS_VERSION 1.0; 1.1; 2.0 and APPLICATION Bar HAS_VERSION 1.0; 2.0; 3.0; But the Version nodes 1.0 and 2.0 for both applications should be seperate nodes. So this example should display altogether 8 nodes (2 applications and 6 versions) in the graphdatabase. Is their a straightforward way to implement this with spring-data-neo4j? I already tried to use the @Unique annotation on the Version-Set in my Application POJO-Class. But this results in unique nodes for each version. So the example above displays 6 nodes (2 applications and 4 versions) in the database. And both applications have HAS_VERSION-relationships to the version nodes 1.0, 2.0. But I want explictly unique Version-"subnodes" for each application, because a USES-relationship to a version of an depending application should be directly visible in the database. With the unique Version-node it is not.
I also implemented a self-made way to do this. But it wasn't very efficient, because i do use many write and read-operations on the database. And some applications have many versions. So the @Fetch annotation is very resource-wasting. And now I am curious if spring-data-neo4j already provides a solution for my problem. Is their something to solve this efficiently?