I have a database with the structure below:
**Dimension_A**
Key_1
Key_2
**Dimension_B**
Key_2
Key_3
**MyTable**
ID
key_1
key_2
key_3
The table Dimension_A has a composite ID made up of key_1 and key_2
The table Dimension_B has a composite ID made up of a field with the same name as in Dimension_A (key_2) and another field (key_3)
I am trying to add a record to the table "MyTable". When doing do I get the error: Invalid index 4 for this SqlParameterCollection with Count = 4
Now I understand that this has to do with the fact that the name of key_2 is duplicated in both tables.
I have no control over the database so cannot change the column names. Is there any way to alias table names when referencing tables in the mapping so that this is no longer a problem?
BTW - I am using Fluent NHibernate to implement this