Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner Join and unique results

 
Wojciech Sielski
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to retrieve data from database using criteriabuilder. It's working great, query is almost perfect... almost. Unfortunately Java don't want me to use group by or distinct as a result of my query. How to make Java retrieve only unique records? My code is here:



Any idea?
 
James Sutherland
Ranch Hand
Posts: 553
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error are you getting?

See,
http://en.wikibooks.org/wiki/Java_Persistence/Criteria#Group_By

For Criteria groupBy examples.
 
Wojciech Sielski
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There was no error. Just duplicated records. But now I've found bug. I was creating query before I've set distinct parameter to true.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic