| I suppose that the developer would rather have the JDBC driver or database fail than failing early and maybe wrongly. Maybe a future database version supports that syntax. Apart from that, I agree that `supportsTupleDistinctCount` should be considered. It's not even used currently as far as I can tell. Can you change the count on the query object to counting on a different column? You could for example do something like the following
if (queryObject.getModel() instanceof IdentifiableType && !((IdentifiableType) queryObject.getModel()).hasSingleIdAttribute()) {
query.select(criteriaBuilder.countDistinct(queryObject.get("myComputedColumn")));
} else {
query.select(criteriaBuilder.countDistinct(queryObject));
}
|