Hi,
I am having a problem getting clollection which have a bidirectional
one-to-many / many-to-one mapping.
first mapping
Code:
<class name="Products" table="Products">
<id name="productID" type="int" unsaved-value="null">
<column name="ProductID"/>
</id>
<set name="orderDetails" inverse="true">
<key>
<column name="productID"/>
</key>
<one-to-many class="OrderDetails"/>
</set>
</class>
and second
Code:
<class name="OrderDetails" table="[Order Details]">
<composite-id>
<key-property name="orderID" column="OrderID"/>
<key-many-to-one name="productID" column="ProductID"
class="Products"/>
</composite-id>
</class>
When I get collection "orderDetails", I have Exception:
detailMessage:
[Microsoft][ODBC Microsoft Access Driver] Duplicate output alias 'ProductID__'.
sql:
select orderdetai0_.productID as productID__, orderdetai0_.OrderID as OrderID__, orderdetai0_.ProductID as ProductID__, orderdetai0_.OrderID as OrderID0_, orderdetai0_.ProductID as ProductID0_ from [Order Details] orderdetai0_ where orderdetai0_.productID=?