-->
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 Get Distinct Row using hibernate
PostPosted: Tue Jan 16, 2007 5:39 pm 
Newbie

Joined: Tue Jan 09, 2007 12:45 pm
Posts: 13
What will be the easiest method to get the distinct value

for example

'Select distinct region from Organization'


Should I use Criteria api

- Should I use NamedQuery

or Should I use session.CreateSqlQuery().

any help is appreciated,

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 8:50 pm 
Regular
Regular

Joined: Sun Sep 17, 2006 2:48 am
Posts: 81
Location: California
I use simple HQL (I usually avoid createSQLQuery)

select distinct cat.name from Cat cat


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 11:43 pm 
Newbie

Joined: Tue Jan 09, 2007 12:45 pm
Posts: 13
somu wrote:
I use simple HQL (I usually avoid createSQLQuery)

select distinct cat.name from Cat cat


I did the same thing in my query, if possible can somebody take a look at it http://forum.hibernate.org/viewtopic.php?t=969743


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.