Distinct in SQL is leading to ORA-00932: inconsistent datatypes: expected - got CLOB

Hi,
we try to update our Wildfly, which is leading to an upgrade of hibernate to 6.4.4.

The migration guide says:
From Hibernate ORM 6, distinct is always passed to the SQL query and the flag QueryHints#HINT_PASS_DISTINCT_THROUGH has been removed.

Because of clob columns in the query the distinct is leading to an

ORA-00932: inconsistent datatypes: expected - got CLOB

With Hibernate 5.x we used QueryHints#HINT_PASS_DISTINCT_THROUGH=false to avoid the ‘distinct’ in the sql.

Is there any way to avoid the ‘distinct’ in the sql with Hibernate 6.
Are there any other solution for such a problem?

Read the migration guide which mentions that distinct might not be necessary.

Thanks for pointing out. I did misunderstood the migration guide.
Removing ‘crtieriaQuery.distinct(true)’ resolved my problem.
Thanks again