| hibernate.query.passDistinctThrough=false hint is ignored if hibernate.use_sql_comments=true. See attached test case. The issue is in org.hibernate.loader.Loader.processDistinctKeyword(String, QueryParameters). It assumes that the query string starts with 'select distinct'. However, if comments are enabled, the query will start with the comment (/..../). |