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