I think I've got it figured out. An unsaved-id wasn't configured properly so when the Animal was the aggregate root it worked because we saved it directly. Now that it's no longer the root NH needs to know the unsaved-id. Makes perfect sense :)
And thanks for the error message which pointed out the exact problem :) On May 25, 10:20 am, Shane C <[email protected]> wrote: > We are making changes to our model and have ran into an issue with the > way a foreign key is being populated. We use to have... > > Animal instance > has a bag of StateChange instances (Birth, Death) > > This worked great for awhile but we had to add another layer to that > and now have... > > AnimalSeries instance > has a bag of Animal instances > has a bag of StateChange instances > > The problem is that when we try and save an AnimalSeries we run into a > foreign-key violation. StateChange has a field called ANIMAL_ID which > has a foreign-key to the Animal instance but it's being populated with > a 0. > > This to me almost sounds like the normal "NH doesn't persist > collections nicely" problem but my question is why did this work fine > before we added the additional layer? > > Thanks, > > Shane --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
