Ah...4) a remove an existing Pet (mean remove only the association, the animal stay alive).
The life of an persistent-layer's developer is not so easy ;) 2009/5/12 Fabio Maulo <fabioma...@gmail.com> > 2009/5/12 Krzysztof Kozmic <kkoz...@atsisa.com> > >> Well, as I said - I'm quite new here, so I may be discovering things, >> that are obvious for the experienced ones of you :) >> >> Thanks Roger for your explanation. I know that having the two-way inverse >> association would workaround the issue, but there are still situations where >> it's not welcome to introduce the child-to-parent association in the code. >> >> Now that I know how NH works this out, I'm thinking if it would be >> appropriate (feasable) to introduce a patch that would change its behavior >> to merge the insert pet with update pet. >> > > The test you should write should be enough complex to prevent ugly breaking > changes. > Try it with a complex graph with complex cascade. > In your example you should try to solve even another case. > A Animal (Pets) can exists even without a owner (Person); that is what you > are doing using unidir. > Now create a new Person and add it 3 Animals : > 1) a persistent animal changing its owner > 2) a NO persistent Animal (a new one) > 3) a persistent Animal but without a previous owner > > then save the new Person. > For Animal you should try it using: > <subclass> > <joined-subclass> > <subclass>+<join> > <union-subclass> > > Let us know which is the result. > > The test is more important than the fix. Right test mean right fix; wrong > test mean wrong fix. > > -- > Fabio Maulo > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---