Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 54469 invoked from network); 5 Dec 2007 22:59:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2007 22:59:53 -0000 Received: (qmail 42704 invoked by uid 500); 5 Dec 2007 22:59:41 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 42684 invoked by uid 500); 5 Dec 2007 22:59:41 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 42675 invoked by uid 99); 5 Dec 2007 22:59:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 14:59:41 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [212.224.30.66] (HELO service-01.spree.de) (212.224.30.66) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 22:59:21 +0000 Received: from [172.16.1.21] (rhein.spree.de [172.16.1.21]) (authenticated bits=0) by service-01.spree.de (8.13.4/8.13.4/Debian-3) with ESMTP id lB5MxKfK004273 for ; Wed, 5 Dec 2007 23:59:20 +0100 Message-ID: <47572D46.7000702@spree.de> Date: Wed, 05 Dec 2007 23:59:18 +0100 From: Michael Bouschen Organization: Tech@Spree Engineering User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: users@openjpa.apache.org Subject: Re: update query syntax for embedded class field References: <0D1719326D64BD4E9F92A0C12023767804421A56@eserv.covergence.com> In-Reply-To: <0D1719326D64BD4E9F92A0C12023767804421A56@eserv.covergence.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Ajay Aggarwal, I think your query is correct and should work. According to the Java Persistence query language BNF the expression following the keyword SET might be a state_field and state_field includes navigation through an embedded: state_field ::= {embedded_class_state_field.}*simple_state_field I propose you file a JIRA issue. Regards Michael > I am trying to update a field of the embedded class using query, but its > not working. In the following code, 'registration' is an embedded class > field inside 'User' and 'authenticated' is a boolean field inside this > embedded class. > > > > Query q = em.createQuery("UPDATE User s SET s.registration.authenticated > = :auth"); > > q.setParameter("auth", false); > > > > I am getting following error. What is the correct syntax for such a > query? > > > > openjpa.persistence.ArgumentException: An error occurred while parsing > the query filter 'UPDATE User s SET s.registration.authenticated = > :auth'. Error message: <4|false|0.9.7> > org.apache.openjpa.kernel.jpql.ParseException: Encountered "." at > character 33, but expected: ["="]. > > > > Thanks. > > > > > -- Tech@Spree Engineering GmbH Tel.: +49/(0)30/235 520-33 Buelowstr. 66 Fax.: +49/(0)30/217 520-12 10783 Berlin mailto:mbo.tech@spree.de Geschaeftsfuehrung: Anna-Kristin Proefrock Sitz Berlin, Amtsgericht Charlottenburg, HRB 564 52