Entity Graphs with WHERE IN

Description

When using Entity Graphs using Hints, combined with a query which takes multi-value parameters, Hibernate throws a NullPointerException.

Example Query: "FROM WHERE IN arameters"

You can find an example that reproduces this issue in the described environment:
https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/entitygraph/src/test/java/org/javaee7/jpa/entitygraph/EntityGraphTest.java

Stacktrace:
Caused by: java.lang.NullPointerException
at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:67) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:613) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1900) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1861) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:909) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2553) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2539) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.Loader.list(Loader.java:2364) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:496) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:231) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1264) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:449) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
at org.javaee7.jpa.entitygraph.MovieBean.listMoviesByIds(MovieBean.java:43) [classes:]

Environment

Hibernate 4.3.5, Wildfly 8.1.0 Final, H2 Database (Wildfly internal Database)

Activity

Show:
Roberto Cortez
December 17, 2014, 10:51 PM

Let me know if I can help with anything else.

Hans Desmet
December 22, 2014, 7:54 AM

This is the same problem as I reported in https://hibernate.atlassian.net/browse/HHH-9230

Roberto Cortez
December 22, 2014, 6:16 PM

Yes, sorry. I've searched if something similar was already reported, but apparently I missed your issue.

Assignee

Unassigned

Reporter

Roberto Cortez

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure