Closed timaebi closed 4 years ago
This fix seems to miss my scenario. I'm getting crashes from AbstractHibernateCriterionAdapter.applySubCriteriaToJunction
calling AbstractHibernateQuery.doTypeConversionIfNeccessary
resulting in No converter found capable of converting from type [org.hibernate.criterion.DetachedCriteria] to type [my.DomainClass]
Background
For a filtered view with pagination we use a DetachedCriteria which specifies all data to be returned. We then run
criteria.count()
andcriteria.list(params)
to receive a page. However this fails, if the criteria contains a detached criteria as subcriteria.Steps to Reproduce
Have a look at the attached project (gorm-bug-report) which describes the error. There is one integration test, which currently fails but shouldn't in our opinion. The project setup was done in a straight forward manner based on grails 3.3.11:
grails create-app gorm-bug-report
User
andOrganisation
with a many-to-one relationship./gradlew integrationTest
and see the test failingExpected Behaviour
Executing the same DetachedCriteria multiple times should return the same results and not throw an exception.
Actual Behaviour
The first execution of the query works well, however a second call throws the following exception:
Environment Information
Example Application
The gorm-bug-report repository contains an integration test, which fails because of the bug.
Related Issues
This issue might be related to grails/grails-data-mapping#59 .