cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ksenia Khailenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAY-1514) ClassCastException when EJQLQuery parameters is null.
Date Tue, 23 Nov 2010 21:42:16 GMT

    [ https://issues.apache.org/jira/browse/CAY-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935062#action_12935062
] 

Ksenia Khailenko commented on CAY-1514:
---------------------------------------

That is because when EJBQLConditionsTranslator processes the NamedParameter and sees the null
value, it expects to see "equals" condition, not "like": EJBQLConditionsTranslator [838-844]

> ClassCastException when EJQLQuery parameters is null.
> -----------------------------------------------------
>
>                 Key: CAY-1514
>                 URL: https://issues.apache.org/jira/browse/CAY-1514
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.0.1
>         Environment: Tomcat 6.0.26
>            Reporter: Marek Ĺ abo
>         Attachments: cayST.txt
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message