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.  [ 4 posts ] 
Author Message
 Post subject: UNIQUE keyword
PostPosted: Sat Feb 24, 2007 6:36 am 
Beginner
Beginner

Joined: Thu Feb 08, 2007 11:11 am
Posts: 24
Location: India
I want to use unique keyword in createQuery method, but everytime it is giving an parsing error. How can i use it?

Plz help..


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 24, 2007 2:16 pm 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
Is your intent to remove duplicate rows?

How about DISTINCT instead of unique?

Budyanto


Top
 Profile  
 
 Post subject: try this out
PostPosted: Sat Feb 24, 2007 2:20 pm 
Newbie

Joined: Mon Feb 19, 2007 12:54 am
Posts: 16
Location: banglore, india
I dont know how to to do it hibernate. But through java u can do like this.

Query q= session.createQuery("some qiery);

List l = q.list();

Set set = new HashSet(list);

Now set contains all the elements.

_________________
Banglore Developer


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 25, 2007 11:30 pm 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
Hi iam supriyo,

Use HQL .Simply type select distinct column from table
Column and table for your understanding

_________________
Dharmendra Pandey


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