We were getting an IndexOutOfRange Exception when trying to save a Period object in our application. Invalid Index 17 for this SqlParameterCollection with Count=17
It was a little confusing as we'd not seen any error like this before:
After a bit of head scratching, we interrogated the mapping file, see if you can spot the error:
Did you spot it? Well, there are two columns called "MORId", one in the main class, and one in the component AgreedWorkLevel. The important thing to remember is that components are stored in the same table and although they are in different classes, they need to be uniquely named.
I would imagine if you wanted the component property to be the same as the class' property, you could link this in code and leave NHibernate pointing to the single reference point.