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.  [ 4 posts ] 
Author Message
 Post subject: fetch records with no association
PostPosted: Thu Jan 22, 2009 8:21 am 
Newbie

Joined: Wed Dec 03, 2008 8:05 am
Posts: 11
Hi All,

I have table A ,Table B and Table C

table B and Table C has parent and children association .

where as Table A does not have any assocition with reamining table .


here my issue is I have a column "DOC_ID" in table A stores Table B's primary Key .

I would like to get some name from the table C by refering Table A's Doc_ID .

I am using <seT> in the TAble A's hbm.xml


like

<Set name='...'>
<key column ="..">
<one-many..../>
</set>


It always trying to refer Table A's primary key....


How can I achieve ???????????????????????????
Can any one suggest me plzzzz....


Top
 Profile  
 
 Post subject: Provide a real world example..
PostPosted: Fri Jan 23, 2009 1:42 am 
Regular
Regular

Joined: Mon Jan 05, 2009 6:42 pm
Posts: 99
Location: IL
Hi,
It seems to me that you don't want to post your business information in the forum. But if you can relate your business model to any thing generic like Employee and Business Units, Bids and Items etc..then it might be helpful for someone to answer back.
-Srilatha.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 23, 2009 12:40 pm 
Regular
Regular

Joined: Tue Dec 30, 2008 8:14 pm
Posts: 50
Please try the following:

<property name="docID" column="DOC_ID" type="long"/>
<bag name="nameFromTableC" table="TABLE_C">
<key property-ref="docID"/>
<element type="string" column="NAME" />
</bag>

---
Please rate


Top
 Profile  
 
 Post subject: Thx for ur response
PostPosted: Wed Feb 04, 2009 1:38 am 
Newbie

Joined: Wed Dec 03, 2008 8:05 am
Posts: 11
hi Lin,
sorry for the late replay.

It is workking fine.

Thx for ur post .


Well

Hi latha,

I thought of my example looks simple .My intention is to make clearer .
So only I have give simple example.


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

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.