[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread Hudson Akridge
You do not *need* a bidirectional, however life will sadly be a lot easier with one. If you don't have a bi-directional, and you attempt to delete a child, without also removing that child from the parent, then you will get a cascade exception. Having the bi-directional in place means that your chi

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread griti
Got it working, had the reference from child to parent once implemented but had not the inverse(), so I added the reference back. Now I have the reference without .inverse().. do I need it in any case? On 15 Sep., 17:21, griti wrote: > Forgot to mention that the database is setting the IDs of

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread griti
Forgot to mention that the database is setting the IDs of the objects, maybe this is also a problem for nhibernate? On 15 Sep., 17:13, griti wrote: > Thanks for the input, now it's storing the fk as expected for Log -> > LogEntry. > > For this case I don't need any reference back from the child.

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread griti
Thanks for the input, now it's storing the fk as expected for Log -> LogEntry. For this case I don't need any reference back from the child. When I remove .Inverse(), I get the following error: [InvalidOperationException: Collection was modified; enumeration operation may not execute.] What I d

[fluent-nhib] Re: Parent's ID in child, with subchilds [one-to-many]

2009-09-15 Thread Hudson Akridge
You have .Inverse() marked on all of your OTM collections, but do not have a reference back from the child side to the parent in the mapping using a References(). In that case, an inverse is not what you'd want to set up on the OTM. Although, if a bi-directional is what you're looking for, then you