-->
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: Hibernate Count Query from two join tables
PostPosted: Sun Jul 11, 2010 2:33 am 
Newbie

Joined: Sun Jul 11, 2010 2:23 am
Posts: 1
Hi,

I'm having difficulty in building the count query in hibernate with two join tables.

The POJO mapping class in one table has the reference to the other table.

Table A has sequenceno,uin

Table b has sequenceno,status

I need the count of uin in table A for the corresponding seq no.

and Sequenceno in table A is mapped to sequence no in table B with foriegn key and the corresponding Pojo class in table A has reference to table B for sequenceno as private A a;

Could any body help me out in building the count query in hibernate.

Could any one let me know how to convert the following sql query into hibenate

select count(uin) from A,B where A.sequenceno=B.sequenceno and A.sequenceno=1;

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.