| This is the expected behavior. The DISTINCT is applied at the SQL level only for projection queries. I think you are confusing it with the DISTINCT behavior for one-to-many collections that are JOIN FETCH-ed, in which case the root entities are deduplicated. You can read this article for a detailed description of DISTINCT. |