Well since this is a scalar query, you have to think in terms of a scalar query result, so this can happen. What would you expect? That Hibernate automatically adds an order by element for the id behind the scenes?