Many things come to me, would it be possible to show us the tables definitions and the sql's generateds by hibernate? and also whiche database you use
Because normally it will return a row for each complete set of data that works for example:
cat1 has 2 kittens
It will find cat1 for the first kitten and after, another time cat1 for the second kitten
Like this the more tables you add the worst it becomes specially with the outer joins. Thats why normally with distinct you can solve it
About your
order problem, I had the same 2 weeks ago, to order by a column you must add it to the select clause, which isn't to nice since your list becomes a list of object arrays instead of a lis of your beans
What I do is add this extra column after what i'm searching off and once i have the list:
Code:
Iterator i = query.list().iterator();
resultat = new ArrayList();
while (i.hasNext()) {
Object[] tuple = (Object[]) i.next();
resultat.add(tuple[0]);
}
and then I have resultat which is the list of what i needed and it is ordered
I hope it helps you