setParameterList() throws an NPE when the list contains null

Description

When using an IN(aram) query, it is currently not possible to have the list set by setParameterList() contain null values.
The folowing exception is thrown:

java.lang.NullPointerException
at org.hibernate.proxy.HibernateProxyHelper.getClassWithoutInitializingProxy(HibernateProxyHelper.java:23)
at org.hibernate.impl.AbstractQueryImpl.guessType(AbstractQueryImpl.java:454)
at org.hibernate.impl.AbstractQueryImpl.setParameterList(AbstractQueryImpl.java:538)

It seems it assumes a not-null value, but it is perfectly sensible to query for something like where xxx.id in (1, 2, null). See for the comment by Gavin.

Environment

linux redhat, hibernate 3.0.5, oracle

Status

Assignee

Unassigned

Reporter

Joris Verschoor

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