Criteria.DISTINCT_ROOT_ENTITY is intended to be used with an org.hibernate.Criteria. It should not be used with native queries.