openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "M M (JIRA)" <>
Subject [jira] Created: (OPENJPA-1307) Problems with parameterized JPQLs and EmbeddedId
Date Fri, 18 Sep 2009 13:43:15 GMT
Problems with parameterized JPQLs and EmbeddedId

                 Key: OPENJPA-1307
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc, kernel
    Affects Versions: 1.2.1
            Reporter: M M

OpenJPA cannot do a SELECT with parameterized JPQL queries and EmbeddedId.

E. g., following configuration doesn't work:

There a two entities: EntA and EntB. Both have a composite primary key (EntAPK and EntBPK)
that is used as an embedded id. I want to execute following query:
SELECT a FROM EntA a WHERE a.entB=:entB

Needlays to say, the parameter is an object of the entity EntB.

While executing the getResultList method I get following exception:

Caused by: java.lang.ClassCastException: com.example.EntBPK cannot be cast to [Ljava.lang.Object;
        at org.apache.openjpa.jdbc.kernel.exps.Param.appendTo(
        at org.apache.openjpa.jdbc.kernel.exps.EqualExpression.appendTo(
        at org.apache.openjpa.jdbc.kernel.exps.CompareEqualExpression.appendTo(
        at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.buildWhere(
        at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.evaluate(
        at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.createWhereSelects(
        at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery(
        at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(
        at org.apache.openjpa.kernel.QueryImpl.execute(
        at org.apache.openjpa.kernel.QueryImpl.execute(
        ... 44 more

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

View raw message