cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: EJBQL doesn't support null parameters
Date Tue, 10 Nov 2009 12:13:18 GMT
Probably a bug. I though that worked though.

On Nov 10, 2009, at 1:50 PM, Andrey Razumovsky wrote:

> Hi,
>
> Currently EJBQL parameter cannot be set as null. Test is simple as  
> follows:
>
> EJBQLQuery query = new EJBQLQuery("select p from Painting p WHERE
> p.toArtist=:x");
> query.setParameter("x", null);
> createDataContext().performQuery(query);
>
> Caused by: java.lang.ClassCastException:
> org.apache.cayenne.reflect.generic.DataObjectToOneProperty cannot be  
> cast to
> org.apache.cayenne.reflect.AttributeProperty
>    at
> org 
> .apache 
> .cayenne 
> .access 
> .jdbc 
> .EJBQLConditionTranslator 
> .processParameter(EJBQLConditionTranslator.java:708)
>    at
> org 
> .apache 
> .cayenne 
> .access 
> .jdbc 
> .EJBQLConditionTranslator 
> .visitNamedInputParameter(EJBQLConditionTranslator.java:345)
>
> Is it OK or this is a bug? I mean, is this case covered by JPA spec,  
> since
> it i think we still should keep it where possible


Mime
View raw message