openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Donald Woods (JIRA)" <>
Subject [jira] Updated: (OPENJPA-1043) JPQL queries do not support queries on a MappedSuperclass
Date Tue, 22 Sep 2009 19:16:16 GMT


Donald Woods updated OPENJPA-1043:

    Affects Version/s: 1.3.0
        Fix Version/s:     (was: 2.0.0-M4)
                           (was: 2.0.0)

> JPQL queries do not support queries on a MappedSuperclass
> ---------------------------------------------------------
>                 Key: OPENJPA-1043
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 1.2.1, 1.3.0, 2.0.0-M2
>            Reporter: Jeremy Bauer
>            Assignee: Pinaki Poddar
>             Fix For: 2.0.0-M3
>         Attachments:
> This issue was reported by Jim Weaver via a nabble user forum post[1].  The JPA specification
clearly states that queries upon a mapped superclass are not permitted, but the OpenJPA documentation
has a note saying that they are supported[2].
> Given:
> @MappedSuperclass class A { }
> @Entity class B extends A { }
> @Entity class C extends A { }
> I found that:
> a) The em.find(A.class, id) operation does indeed allow the use of mapped superclass.
OpenJPA issues a select upon tables B and C looking for a matching ID.
> b) A JPQL query does not:  SELECT a FROM A a  fails with exception: (as reported by Jim)
> I receive error message "An error occurred while parsing the query filter
> "SELECT a FROM A a".  Error message:   The name "A" is not a recognized
> entity or identifier.  Perhaps you meant B, which is a close match.  Known
> entity names: [B, C]"
> I attempted the same test with the OpenJPA base 1.0 provider and it failed with the same
error so it doesn't look like this was ever supported via. JPQL.
> If the decision is made not to provide this support in the near future, the documentation
should be updated to qualify that mapped superclass is only allow on a find.
> [1]
> [2]

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

View raw message