Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B1D3774A0 for ; Wed, 26 Oct 2011 19:35:55 +0000 (UTC) Received: (qmail 98516 invoked by uid 500); 26 Oct 2011 19:35:55 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 98480 invoked by uid 500); 26 Oct 2011 19:35:55 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 98445 invoked by uid 99); 26 Oct 2011 19:35:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2011 19:35:55 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2011 19:35:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 28C4931D909 for ; Wed, 26 Oct 2011 19:33:32 +0000 (UTC) Date: Wed, 26 Oct 2011 19:33:32 +0000 (UTC) From: "Laird Nelson (Commented) (JIRA)" To: dev@openjpa.apache.org Message-ID: <2064645780.19841.1319657612168.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <187527537.14508.1319565752370.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (OPENJPA-2065) JPA 2.0 Spec. Violation? EntityManager#createNamedQuery(String, Class) bombs with non-entity Class parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-2065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136258#comment-13136258 ] Laird Nelson commented on OPENJPA-2065: --------------------------------------- That would imply among other things that this too is illegal: final TypedQuery q = em.createNamedQuery("someQueryThatReturnsAnAggregateOrCOUNTResult", Long.class); And this: final TypedQuery q = em.createNamedQuery("someQueryThatReturnsAnObjectArrayBecauseOfStuffInTheSelectClause", Object[].class); Is that really the case? Section 2.11 has very narrow scope. 2.11.3 would seem to have been conceived of within the bounds of that scope, not within the bounds of the entire specification. Nevertheless, there it is. That is really unfortunate. I'll ask the sleepy users@jpa-spec.java.net list, where I appear to be the only poster, what they think. > JPA 2.0 Spec. Violation? EntityManager#createNamedQuery(String, Class) bombs with non-entity Class parameter > ------------------------------------------------------------------------------------------------------------ > > Key: OPENJPA-2065 > URL: https://issues.apache.org/jira/browse/OPENJPA-2065 > Project: OpenJPA > Issue Type: Bug > Components: jpa > Affects Versions: 2.1.0, 2.1.1 > Reporter: Laird Nelson > Labels: specification > > 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 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. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira