Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.1
-
None
-
Tomcat 6.0.26
Description
When a parameter in EJBQLQuery is set to null, an error occurs which results in ClassCastException. When parameter is not null query is executed as expected.
It is duplicable with following/similar code:
EJBQLQuery eq = new EJBQLQuery("SELECT COUNT(u) FROM User u WHERE u.username like :usernam AND u.userInfo.name like :userName");
eq.setParameter("userName", null);
eq.setParameter("usernam", "msabo");
return (Long) DataObjectUtils.objectForQuery(getObjectContext(), eq);
Full stack trace is in attachment.