I've been tracing some performance issues and found an issue with the `GormEntity.exists` when using Hibernate. In [AbstractHibernateGormStaticApi](https://github.com/apache/grails-data-mapping/blob/00fbc39170146c6ae844c66c7e2056a4e7565ba6/grails-data-hibernate5/gorm/src/main/groovy/org/grails/orm/hibernate/AbstractHibernateGormStaticApi.groovy#L217) each call to `criteriaQuery.from` creates a new query root. The resulting HQL looks like this: ``` select count(generatedAlias0) from SomeDomain as generatedAlias1, SomeDomain as generatedAlias0 where generatedAlias1.id=1L ``` It looks like it just needs to have one of the calls to `criteriaQuery.from` eliminated.