From dev-return-6567-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Fri Oct 26 07:47:14 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 48904 invoked from network); 26 Oct 2007 07:47:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2007 07:47:14 -0000 Received: (qmail 36951 invoked by uid 500); 26 Oct 2007 07:47:01 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 36932 invoked by uid 500); 26 Oct 2007 07:47:01 -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 36923 invoked by uid 99); 26 Oct 2007 07:47:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2007 00:47:01 -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, 26 Oct 2007 07:47:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 90B5171422E for ; Fri, 26 Oct 2007 00:46:50 -0700 (PDT) Message-ID: <8725217.1193384810567.JavaMail.jira@brutus> Date: Fri, 26 Oct 2007 00:46:50 -0700 (PDT) From: "minewile (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-420) JPQL constructor query close the feature? ------------------------------------------------------------ Key: OPENJPA-420 URL: https://issues.apache.org/jira/browse/OPENJPA-420 Project: OpenJPA Issue Type: Bug Components: kernel Affects Versions: 1.0.0 Reporter: minewile Fix For: 1.0.1 DISTINCT keyword,It can be supported in the simple query and subquery,but use constructor query,example:select distinct new org.apache.A(a.id...),the distinct keyword is ignored . I fixed as so: java file:org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder private Expression evalSelectClause(QueryExpressions exps) { if (exps.operation != QueryOperations.OP_SELECT) return null; JPQLNode selectNode = root(); JPQLNode constructor = selectNode.findChildByID(JJTCONSTRUCTOR, true); if (constructor != null) { ... // add:now assign the distinct of the select clause JPQLNode selectClause = selectNode.findChildByID(JJTSELECTCLAUSE, false); if (selectClause != null && selectClause.hasChildID(JJTDISTINCT)) exps.distinct = exps.DISTINCT_TRUE | exps.DISTINCT_AUTO; else exps.distinct = exps.DISTINCT_FALSE; return assignProjections(right(constructor), exps); } else { .. } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.