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 inner join query
PostPosted: Wed Oct 03, 2007 4:00 pm 
Newbie

Joined: Thu May 03, 2007 6:24 pm
Posts: 14
Hello,
I have the address table and my sql query is following:

select l.community_name,l.city,m.community_count,l.state,l.community_address
from address l
inner join(
select community_name,city,state, count(*) as community_count
from address where state = 'AZ'
group by community_name,city,state
) m
on m.city=l.city and m.COMMUNITY_name=l.community_name and l.state=m.state and m.community_count = 1

Assume that i have Address object mapped to this table. Please let me know the equivalent hibernate query for the same.

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.  [ 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.