-->
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: Inner join returning same record multiple times
PostPosted: Mon Dec 14, 2009 1:21 am 
Newbie

Joined: Mon Dec 14, 2009 1:09 am
Posts: 1
I have two tables A and B and both of them donot have any referential integrity. However one field of both the tables is common say 'commonId'. I need to fetch values from both the tables and return and im using the commonId to establish a join. The data returned is just one column repeated n number of times where n=actual no of records it should have actually returned.
If i run the query printed in my database it runs correct data where as the same query returns incorrect data if ran through hibernate interfaces.
sample query
select A.commonid as commonid0_, A.alarmName as alarmName0_, A.moName as moName0_, A.moType as moType0_, B_.id as id2_, B_.displayName as displayN3_2_ from tableA A inner join tableB B_ on A.moid=B_.moid where A.moName='10.64.91.45'
ANy help would be appreciable.

Thanks


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.