Use the MemberAccessResolver for properties mapped with a CompontentMap #101

cremor opened this Issue Oct 3, 2011 · 4 comments


None yet

3 participants

cremor commented Oct 3, 2011

Currently the MemberAccessResolver isn't used for component properties mapped with a ComponentMap. Additionally there is no way to use the Access object which is returned from the MemberAccessResolver to specify the access strategy in a convention (the access strategy can only be specified with the fluent methods).

Either one of this two ways should be possible, preferably the first (MemberAccessResolver).


I've recently run into this limitation and would like to see this implemented.


please provides API examples of what you mean


I think I got it - there's no way in ComponentMap to do: Map(x => x.Name).Access.BackingField(), for example.
I'm not sure it's just an API that's missing. Need to dig further.


ok, I think I'm finally ready to answer this properly.
The reason I think that there are currently no way to configure how component members should be accessed is that in current version of Fluent, mapping components with fields, not properties, does not work. I can't say at the moment what's the problem - is it NHibernate, or Fluent, or both - but if you configure fields inside your ComponentMap derived class, - I did it using Member.Reveal - NHibernate will throw an exception at you about invalid mapping configuration. I will contact guys from NH team and ask them if that scenario is supported, and if it is - I'll do my best to extend an API to get this to work. So, when I get a meaningful info, I'll get back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment