micronaut-data
micronaut-data copied to clipboard
HQL `where in :entityList` when entityList is empty, fails with NPE
Expected Behavior
The HQL select entityA a where a.entityB in :listOfEntityBs
with an empty list does not throw an NPE.
Actual Behaviour
Since 4.1, it seems that if an emptyList is passed into the repository function, it will throw an NPE down in the Hibernate code when Hibernate tries to derive the argument type by using value.getClass()
Steps To Reproduce
- Pull my branch (issue-3045) at https://github.com/rawilder/micronaut-data/tree/issue-3045
- Run the test: AbstractHibernateQuerySpec::"test where in empty list of entities"
- Observe NPE
Environment Information
- MacOS
- jdk 17 corretto
- micronaut data 4.8.x
Example Application
https://github.com/rawilder/micronaut-data/blob/issue-3045/data-hibernate-jpa/src/test/groovy/io/micronaut/data/hibernate/AbstractHibernateQuerySpec.groovy#L74
Version
4.8.x