The javadoc for setParameter(String, Object)
is explicit, saying that the Object value must be non-null. It's a shame that it doesn't throw an exception if a null is passed in, though.
An alternative is setParameter(String, Object, Type)
, which does allow null values, although I'm not sure what Type
parameter would be most appropriate here.