I have this problem on "one-to-many" links.
I have two tables, Like "customers" and "orders". and as ordinary, A customer can have many orders.
My problem is, these two tables are not linked through their ID Columns. They have some other ordinary column like "SimilarColumn". How can I link them? I think I must change the property line of "SimilarColumn".
<list name="OrdersListOfCustomer" lazy="false" fetch="subselect" cascade="all" inverse="true"> <key column="SimilarColumn"> </key> <index column="SimilarColumn"></index> <one-to-many not-found="ignore" class="OrderNameSpace"></one-to-many> </list>
This code dont work. I mean, It works fine but not get any data. But when I put "ID" columns instead of "SimilarColumn", it retrieves the correct data.
|