When saving an entity which contains a collection which is cascaded then the querying of the sub collection does not properly generate table aliases in the where clause.
For instance this is the SQL generated by the attached test SELECT this_.GroupID as GroupID0_0_, this_.Price as Price0_0_ FROM GroupPriceOverride this_ WHERE customeras1_.GroupID = @p0
You can see the where clause is querying an incorrect alias.
I am opening this issue based on the suggestion to do so in http://stackoverflow.com/questions/4337277/nhibernate-using-wrong-table-alias. It is entirely possible that I'm doing something wrong in my mapping so you may wish to check that first.
When saving an entity which contains a collection which is cascaded then the querying of the sub collection does not properly generate table aliases in the where clause.
For instance this is the SQL generated by the attached test
SELECT this_.GroupID as GroupID0_0_, this_.Price as Price0_0_ FROM GroupPriceOverride this_ WHERE customeras1_.GroupID = @p0
You can see the where clause is querying an incorrect alias.