-->
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.  [ 2 posts ] 
Author Message
 Post subject: getting entities with distinct column values.
PostPosted: Mon Aug 27, 2007 7:25 am 
Newbie

Joined: Mon Aug 27, 2007 6:58 am
Posts: 2
Hello All,

I have a entity namely Link which holds the links that a user has visited.

It has "url", "createdTime" and some other properties.

What I try to do is get last 3 Favorite objects, but I want the "url" to be distinct

For example if user has

"www.foo.com", 27/08/2007
"www.bar.com", 26,08/2007
"www.foo.com", 26/08/2007
"www.other.com", 25/08/2007

in his table, when I want last 3 Link, I want to get

"www.foo.com", 27/08/2007
"www.bar.com", 26,08/2007
"www.other.com", 25/08/2007
( not foo duplicated )

How can I create this query with either criteria or hql?

thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 7:47 am 
Newbie

Joined: Mon Aug 27, 2007 6:58 am
Posts: 2
Anyone?


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