-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Specifying join on a different column for set element
PostPosted: Fri Oct 28, 2005 12:49 pm 
Beginner
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.