This issue hit me today (well documented at http://glueclue.blogspot.com/2006/02/hibernate-duplicates-with-join-fetch.html).
From what I understand, one way around this is to use “DISTINCT” in the HQL, but in my case this wasn’t possible because of the type of data in my persisted beans.
I chose to use query.uniqueResult() since I expected a unique result. In any case, a close miss.
Advertisement