Update cascading troubles #3103
Unanswered
alaingaudreau
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an app I'm porting over to NHibernate and am having some issues with cascade updates.
The tax system has these objects (removed most of the properties for clarity)
I need to limit update cascade depts so that changes to properties in a TaxGroup.Members[].Tax or TaxGroup.Members[].TaxGroup properties don't trickle up into the Tax table and are simply ignored but I can change which Tax's a TaxGroup contains.
Tax is modified on it's own.
Generally, we would just set up the update query for TaxGroupMember.TaxRef and TaxGroupMember.TaxGroupRef to limit themselves to Id's and ignore the child properties to make sure no data trickles through to the referenced entities/objects.
The documentation isn't clear on this and after a few hours of toying with various combinations while pouring through different posts, I haven't been able to stumble onto a working solution.
I've tried with xml, Mapping.ByCode and Fluent NHibernate which all give me the same result of saving the changes in those referenced objects no matter what type of Cascade I use.
Here is the mapping code at the moment:
Beta Was this translation helpful? Give feedback.
All reactions