We have a mapping file that that has a joined subclass. Here is the dilema. Inside the subclass, there is a ID field that is the primary key of that table. Then there is a bag that uses another class. That class has its own ID field.
Here is a rough idea of the mapping file.
Employee is joined to User by the EmployeeID and User is joined to DomainUser via the UserID
<class name="Employee" table="Employee">
<id name="EmployeeID" column="EmployeeID">
<generator class="assigned"/>
</id>
<joined-subclass name="User" table="Users">
<key column="EmployeeID" />
<bag name="DomainUsers">
<key column="UserID" />
<one-to-many class="DomainUser" />
</bag>
</joined-subclass>
</class>
What we are trying to accomplish is retreving the employee based on the DomainUserName. I am able to look it up and retreive the correct UserID from the domain table but it appears to look that value up in the Users table, however it appears to think that is the EmployeeID instead of the userID. I need to query the table for the EmployeeID with the UserID that is returned from the DomainUser table. Any advice. We are a bit stumped. Any help is appreciated.
TIA,
~CK
|