I have shopping cart component in Customer class:
Code:
<component name="ShoppingCart">
<many-to-one name="Customer" column="CustomerID"/>
<bag name="Items" table="ShoppingCart" access="field.camelcase" cascade="all">
<key column="CustomerID"/>
<composite-element class="DomainModel.CartItem, DomainModel">
<property name="Quantity" column="Quantity" type="Int32"/>
<many-to-one name="Product" column="ProductID"/>
</composite-element>
</bag>
</component>
When I trying to update customer NH throws ADOException with inner SqlException: "Column name 'CustomerID' appears more than once in the result column list.".
If I comment "<many-to-one name="Customer" column="CustomerID"/>" line all updates works and after update I can uncomment it and works with bidirectional association fine.
Is it bug or feature? I think if I can retrieve data with this mapping it must work with update/insert too.