Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2065

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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0, 2.1.1, 2.2.0
    • 2.2.0
    • jpa

    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.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            curtisr7 Richard G. Curtis
            ljnelson Laird Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment