Paul,

Many, many thanks for this!  I now have working code I can start
putting in my application.

Also, because you provided a fully working, standalone project, I was
able to figure out why I'd been unable to get overrides to work in the
past.

I had been putting my map override classes (e.g.  public class
StoreMap : IAutoMappingOverride<Store> { ... ) in the same file and
namespace as the Entity (the class "Store", in this case) was defined
in.  Seemed like a logical place to put it - the class being
overridden and it's overrides are logically related, after all.

Much to my surprise, NHibernate throws "NHibernate.MappingException:
(XmlDocument)(2,4): XML validation error: ..." when you do this, with
absolutely no indication of what or where the real problem is - at
least as far as I could see.

By studying your project in it's entirety, I saw that the override
classes were defined in a different namespace (you did not mention
that in your posting above).

Maybe this is common knowledge to everyone else, but it was a BIG
surprise to me!

But because you went the extra distance and provided a fully working
sample, I was able to figure it out.  ((Think I'll add a note to the
Automapping Wiki page, to prevent others from making the same
mistake.)

I moved the override classes from my entity namespace to my
application's namespace, and everything worked fine.  As a bonus, I
can now map simple lists of floats, which is another issue I've
struggled with.

Thanks again!

-Tom

--

You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" 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/fluent-nhibernate?hl=.


Reply via email to