I agree with kazanaki's answer, and it helped me. I wanted to select the whole entity, so I used
select DISTINCT(c) from Customer c
In my case I have many-to-many relationship, and I want to load entities with collections in one query.
I used LEFT JOIN FETCH and at the end I had to make the result distinct.