Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fetching - Critereon - Distinct??

 
Ben Klug
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to generate a Query by Criterion. But I got lost now Can someone see the mistake I make?



No I add another criterion



level -> admin is a one to many connection.

Result: Request.getLevel().getAdmin() returns n Admins, but I only want the one with the matching field-value pair.


How do I do that?

Thanks so much!
b.
[ November 28, 2005: Message edited by: Ben Klug ]
 
Ben Klug
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved with setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic