FAQ
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

Search Discussions

  • Andrus Adamchik at Nov 10, 2009 at 12:13 pm
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedNov 10, '09 at 11:50a
activeNov 10, '09 at 12:13p
posts2
users2
websitecayenne.apache.org

People

Translate

site design / logo © 2021 Grokbase