Hi all,

I've been looking into fixing NH-3114 and NH-3491, since they've cost me 
considerable time recently. They relate to component mappings 'leaking', 
eg. mapping two component properties of the same type will cause one to 
inherit bits of the other. After some tinkering, I'm fairly confident that 
NH-3114 has a very similar root cause to NH-3491 and will probably depend 
on the same refactor.

NH-3491 appears to be caused by the assumption that, if the model inspector 
considers a given MemberInfo to be a 'persisted property', something has 
mapped it. But a MemberInfo alone is insufficient to determine this for 
component-related mappings (though it's a nice optimisation). So an 
HbmProperty is going to get created and added by 
AbstractBasePropertyContainerMapper even if no customisers are found for it 
(even empty ones). I think the solution to this is to discard the 
HbmProperty if no customisers are applied, but there're several stack 
frames between there and here, so which is the preferred approach for 
solving this:

   1. Modify all the InvokeCustomizers methods to return the number of 
   customisers applied, adjust Action<IPropertyMapper> to 
   Func<IPropertyMapper, int> as necessary (with similar updates elsewhere), 
   and generally just pass the necessary info as return values.
   2. Add a ReceivedCustomizations boolean property/count property/method 
   to the IPropertyMapper interface (and probably its siblings) so 
   InvokeCustomizers can 'mark' the subject as having had customisers applied 
   to it.

Basically boils down to a choice between marking the thing that's getting 
mapped, or passing an integer through the stack.

*Which approach would the development community consider preferable from a 
maintenance (and prettiness) perspective?* Or am I tackling this the wrong 
way, perhaps?

I'm inclined to go for 2 on the grounds that it's less likely to be a 
breaking change API-wise. 

*Would it be worth basing the fix on the 4.1.0.CR tag, or should I just aim 
straight for version 5?*Thanks,

Alex Davidson
Bluewire Technologies

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to