So I like the ogm tool to insert data into the neo4j graph database, it feels natural to me, and worked for the first two small examples I tried, on the third example i used a bigger database and ran into out of memory in neo4j. i increased the memory from 1GB to 3GB for now, but i think there is an underlying problem with the way session.save(node) works when it comes to adding relationships unless there is a function I didn't see.
i can create a node and save it using session.save(node), then probably use cypher query in ogm to add the relationship based on the id of the nodes, but I think that would be a bit hacky and not in spirit of the ORM/OGM ways?
to add a relationship without using a cipher query,
I am making an object or node(node1) by querying a sql database then have to add every object connected to node1 then add it using the relationship function which adds the objects into a hashset
(node1) <- [(node2),(node3),...(noden)]
but i have to add all the relationship nodes otherwise I would be deleting previous relationship, i presume? which means there is a limit to the number of relationships that I can add because I have to keep all the objects related to a node in memory in the application and hope neo4j has enough memory to be able to handle that insertion/merge.
is there a way to say, node1.addthisrelation(node2.id) and save that into the database without loading or adding the entire node1 with all the associated nodes into memory? or addRelation(node1,node2,relationtype) or do I have to use cipher query and if so what the way to save node1 with id 1, has relationship x, to node2 with id 2?