Passing empty list as parameter to JPA query throws error

后端 未结 7 1794
无人共我
无人共我 2020-12-05 22:52

If I pass an empty list into a JPA query, I get an error. For example:

List municipalities = myDao.findAll();  // returns empty list
em.c         


        
7条回答
  •  孤街浪徒
    2020-12-05 23:20

    I struggled with this issue, too. I found out that the Hibernate community has RESOLVED the issue in Hibernate version 5.4.10, here is the ticket: https://hibernate.atlassian.net/browse/HHH-8091

    You can check your Hibernate version System.out.println(org.hibernate.Version.getVersionString());

    And you can UPDATE the version of Hibernate to the latest, here is a useful link: https://bintray.com/hibernate/artifacts/hibernate-orm#

提交回复
热议问题