| Thank you Christian Beikov for the suggestion, but I still don't understand why Hibernate delegates the count to the JDBC driver even if the dialect supportsTupleDistinctCount returns false. I think the Exception should be thrown by Hibernate as not supported operation and not by the driver as syntax error. Beside that, since I'm counting with the Criteria API (using countDistinct() on the query object I have no means to change the column to count on, so I'm a little bit stuck on this. I was hoping on a way to customize the SQL produced by countDistinct() in a custom dialect, but I hadn't found a way to do so. |