Issue Type: Bug Bug
Affects Versions: 4.1.5.SP1
Assignee: Unassigned
Components: query-hql
Created: 22/Oct/12 3:21 AM
Description:

In HHH-2037 a Query.setProperties(Map) method was introduced to set query named parameters using a Map. Unfortunately this method silently ignores null values contained in the Map.

See org.hibernate.internal.AbstractQueryImpl.setProperties(Map), here it is checked whether the value is not null. Only if it is not null it is added as parameter.

However the Javadoc clearly states that there are Map implementations which contain null values, a return value of null for the java.util.Map.get(Object) method does not necessarily indicate that the key is not contained in the Map. To check whether a key is contained in the Map, the containsKey(Object) method should be used.

If it is not possible to fix the Query.setProperties(Map) method, the Javadoc regarding this method should at least include a hint that null values are never bound to the named parameters using this method. It might be difficult to bind the null values, because the original type of these values is not known anymore in this method.

Environment: 4.1.5.SP1
Project: Hibernate ORM
Priority: Major Major
Reporter: Matthias Otterbach
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira