From dev-return-4356-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Fri Jun 01 12:40:50 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 22363 invoked from network); 1 Jun 2007 12:40:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jun 2007 12:40:37 -0000 Received: (qmail 14752 invoked by uid 500); 1 Jun 2007 12:40:41 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 14708 invoked by uid 500); 1 Jun 2007 12:40:40 -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 14699 invoked by uid 500); 1 Jun 2007 12:40:40 -0000 Delivered-To: apmail-incubator-open-jpa-dev@incubator.apache.org Received: (qmail 14696 invoked by uid 99); 1 Jun 2007 12:40:40 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 05:40:40 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 05:40:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 93796714180 for ; Fri, 1 Jun 2007 05:40:15 -0700 (PDT) Message-ID: <4391076.1180701615580.JavaMail.jira@brutus> Date: Fri, 1 Jun 2007 05:40:15 -0700 (PDT) From: "Daniel Gajdos (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Created: (OPENJPA-249) problem using enum with @Enumerated annotation in Query MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org problem using enum with @Enumerated annotation in Query ------------------------------------------------------- Key: OPENJPA-249 URL: https://issues.apache.org/jira/browse/OPENJPA-249 Project: OpenJPA Issue Type: Bug Components: query Affects Versions: 0.9.7 Environment: Windows XP, WAS 6.1 Reporter: Daniel Gajdos Situation description: @Entity public class Application { ... @ManyToOne(optional = false) @JoinColumn(name = "C_APPLICATION_STATUS", nullable = false) @ForeignKey(name = "FK_APPLICATION__APPLICATION_S") private ApplicationStatus applicationStatus; ...} @Entity public class ApplicationStatus { public static enum Code { created } @Id @Column(name = "C_CODE") @Enumerated(EnumType.STRING) private Code code; } And now the problem: When executing query "SELECT a FROM Application a WHERE a.applicationStatus = :status" with parameter q.setParameter("status", ApplicationStatus status); everything works fine. But when trying to call the query like "SELECT a FROM Application a WHERE a.applicationStatus.code = :package.ApplicationStatus.Code.created " it fails with: Attempt to query field "package.ApplicationStatus.Code.waiting" from non-entity class "null". Is there any way to create a query with built in enum value? I found a similar issue on http://forums.oracle.com/forums/thread.jspa?threadID=506389&tstart=45 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.