OpenJPA
  1. OpenJPA
  2. OPENJPA-2065

JPA 2.0 Spec. Violation? EntityManager#createNamedQuery(String, Class) bombs with non-entity Class parameter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0, 2.1.1, 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: jpa
    • Labels:

      Description

      Suppose we have an interface, A.

      Suppose we have a JPA-compliant entity class, B, that implements A.

      This construction will fail at runtime:

      final TypedQuery<A> q = em.createNamedQuery("someNamedQuery", A.class);

      Hibernate and EclipseLink both accept this construction.

      I don't see anywhere in the JPA specification that the class parameter must denote an entity type.

        Issue Links

          Activity

            People

            • Assignee:
              Rick Curtis
              Reporter:
              Laird Nelson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development