This is absolutely not a hibernate relative bug. I’d say that this is not a bug at all. Spring Data (starting from 3.x) parses your @Query string and generates a new query. When you create PageRequest you should use aliases from the the query: r.name instead of role.name: Order order = new Order(ASC, "r.name"); In your case, spring data sees, that “left join” is absolutely useless and removes it from the query. Then spring data adds a new inner join with Role to satisfy your Sort request. |