NHibernate white space, or "How to make give your error messages good gestalt"
NHibernate is senstive to white space. Who'da thunk?
Here is the .hbm file that was causing problems:
<generator class="foreign"> <param name="property"> _maker </param> </generator>
And the error message it eventually generated:
An exception of type 'NHibernate.HibernateException' occurred in NHibernate.dll but was not handled in user code
Additional information: unmapped property: OzarkInc.BanjoMakinThingy.BanjoFactory.
_maker
I say eventually because it didn't actually give us any problems until we started saving new entities. Note that I have not formatted the message. The space 'twixt BanjoFactory and _maker appeared as above in our error messages. Which should have been my first clue as to the problem but it took a fellow hillbilly to find it. And since he's a smart'un and doesn't blog, that gives me a chance to increase my readership at his expense. (And since I know he wanders over here on occasion: Craig, consider this a formal goading to get your blog going.)
Anyway, back to my problems which is why you're all here. The simple fix:
<generator class="foreign"> <param name="property">_project</param> </generator>
So let that be a warning to you. Press Ctrl+K, Ctrl+D in your XML files at your own risk.