I wonder if it is possible to map the following:
- Suppose I have a table called "ServicesOrders" and "Users".
- ServicesOrders have 2 foreign keys, both from Users:
-- ServicesOrders
---- AnalystId (User)
---- TechnicianId (User)
So, in the User class I want to map the ServicesOrders table, ok? I could simple have two List<ServiceOrder> like follow:
Code:
public class User {...
private List<ServiceOrder> analystServicesOrders;
private List<ServiceOrder> technicianServicesOrders;
...}
In the mapping I would create two bags, one for each list:
Code:
<bag name="analystServicesOrders" table="ServicesOrders" lazy="true">
<key column="AnalystId" not-null="false"/>
<one-to-many class="ServiceOrder"/>
</bag>
<bag name="technicianServicesOrders" table="ServicesOrders" lazy="true">
<key column="TechnicianId" not-null="false"/>
<one-to-many class="ServiceOrder"/>
</bag>
Ok, but I don't want to do that.
I want to have only one List<ServiceOrder> inside User class.Is this possible somehow?