From dev-return-8939-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Sat Aug 09 11:57:06 2008 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 55119 invoked from network); 9 Aug 2008 11:57:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Aug 2008 11:57:05 -0000 Received: (qmail 47427 invoked by uid 500); 9 Aug 2008 11:57:04 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 47404 invoked by uid 500); 9 Aug 2008 11:57:04 -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 47393 invoked by uid 99); 9 Aug 2008 11:57:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Aug 2008 04:57:04 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Aug 2008 11:56:16 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 40AEB234C197 for ; Sat, 9 Aug 2008 04:56:44 -0700 (PDT) Message-ID: <701759177.1218283004253.JavaMail.jira@brutus> Date: Sat, 9 Aug 2008 04:56:44 -0700 (PDT) From: "wilesun (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-690) JPQL select express support alias MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org JPQL select express support alias --------------------------------- Key: OPENJPA-690 URL: https://issues.apache.org/jira/browse/OPENJPA-690 Project: OpenJPA Issue Type: Bug Components: kernel Affects Versions: 1.1.0 Reporter: wilesun Fix For: 1.1.1 I hope the JPQL supprt the templete:(it can work with hibernate jpa) select o.id, o.name as aName, o.code aCode form A o where .. I modifid the jpql.jtt 1.jpql.jtt void select_expression() #SELECTEXPRESSION : { } { ((aggregate_select_expression() | LOOKAHEAD(path()) path() | identification_variable() | ( "(" identification_variable() ")") | constructor_expression() | select_extension() | string_literal() | numeric_literal()) [LOOKAHEAD(1)] [LOOKAHEAD(identification_variable())identification_variable()]) } 2:openjpa-kernel\src\main\java\org\apache\openjpa\kernel\jpql\JPQLExpressionBuilder.java private Expression assignProjections(JPQLNode parametersNode, QueryExpressions exps) { int count = parametersNode.getChildCount(); exps.projections = new Value[count]; exps.projectionClauses = new String[count]; exps.projectionAliases = new String[count]; Expression exp = null; for (int i = 0; i < count; i++) { JPQLNode parent = parametersNode.getChild(i); JPQLNode projNode = firstChild(parent); JPQLNode aliasNode = parent.children.length > 1 ? right(parent) : null;; Value proj = getValue(projNode); String alias = aliasNode == null ? lastChild(projNode).text : aliasNode.text; exps.projections[i] = proj; exps.projectionClauses[i] = assemble(projNode); exps.projectionAliases[i] = alias; } return exp; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.