Beginner |
|
Joined: Wed Jul 06, 2005 4:51 pm Posts: 27
|
Hi
I am trying to use <element> within set.
I have a User table with userId as the primary key, this table is in one to many relation with GroupLink table. The joining column is groupId in both the tables. ( one-to-many is not mentioned in the mapping files )
As I am only interested in one of the columns (ancestorGroupId ) in the GroupLink table, I am using <element> ( didn't want to create a new object ). But <element> seems to be using the primary key ( userId ) from User table when it is doing a join onto GroupLink. How can I force it to use groupId column in User to be joined with groupId column in GroupLink
<set name="Groups" table="GroupLink" lazy="false">
<key column="groupId"/>
<element column="ancestorGroupId"type="integer"/>
</set>
|
|