-->
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.  [ 3 posts ] 
Author Message
 Post subject: how to fetch records form 2 differnt tables using Criteria
PostPosted: Wed Dec 10, 2008 7:52 am 
Newbie

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

I am using Criteria.



I have 2 table .suppose say Table A and table B .

Table A has id1 and Table B has id2 . And TableB has association with Table A(many-one Association).

In the Criteria How can I compare 2 table from id1 Table A to id2 Table B .


Query as follows :

select * from TableA a,TableB b where a.id1 = b.id2.

how can I write the above query in Criteria.

plzzz help it is too urgent.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 10, 2008 10:11 am 
Beginner
Beginner

Joined: Thu Oct 02, 2008 10:15 am
Posts: 21
Official documentation related to Criteria and Example queries should be able to help you out.
e.g.
http://hibernate.org/hib_docs/v3/refere ... mples.html


Top
 Profile  
 
 Post subject: It does not match with my req...
PostPosted: Fri Dec 12, 2008 2:00 am 
Newbie

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

Thx for ur replay Ravi .

It does not match with my requirment.

We need to give assocation in hbm file, ofcourse we ought be.

I would like to compare 2 objects say A.id1 = B.id2

A is Tabl1A and B is TableB.

I did not find in the like u provided.,

Please if u know more about post me ............

Thanks in Advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.