I'll have a go If the graph can have loops in it, then there will almost certainly be a point where it needs to save something that cant be saved until something later in the graph is saved, which will be impossible.
I can only suggest that you save the nodes separately first, then call a cascading update on the node-link graph. FP 2009/10/6 Arvind <[email protected]> > > *trolling* > > A suggestion/response/answer would be nice! Anyone? > > On Oct 5, 1:49 pm, Arvind <[email protected]> wrote: > > I have 2 tables - > > 1) Nodes > > 2) Links > > > > Links connect 2 nodes - as Source and Destination. > > For Link to be saved - it's Source and Destination notes must be non- > > null. > > Each node can have multiple Links. > > > > Now in my object graph (that is created programmatically) I want to > > call Save on teh root node and have it cascade the save down Links and > > Nodes. > > > > I am not sure how to assign the cascades. > > I tried assigning > > - (cascade="none") for Links collection of the source node > > - (cascade="none") for the Source and Destination nodes of the Link > > - (cascade="save-update") for the Destination node > > > > but it gives me the error that Link object should be saved before > > flushing. It's null reference or transient :( > > > > I'm at my wits' end as to how to save this kind of a potentially > > continuous graph. > > Since NHibernate should save the Nodes before it saves teh links > > (since Links depend on the Nodes for their FKs). > > > > Please HELP!!!! > > > > Thank you! > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
