Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 58393 invoked from network); 5 Dec 2007 23:05:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2007 23:05:51 -0000 Received: (qmail 49057 invoked by uid 500); 5 Dec 2007 23:05:39 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 49037 invoked by uid 500); 5 Dec 2007 23:05:39 -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 49028 invoked by uid 99); 5 Dec 2007 23:05:39 -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 15:05:39 -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: domain of mprudhomapache@gmail.com designates 209.85.198.185 as permitted sender) Received: from [209.85.198.185] (HELO rv-out-0910.google.com) (209.85.198.185) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 23:05:18 +0000 Received: by rv-out-0910.google.com with SMTP id k20so4610853rvb for ; Wed, 05 Dec 2007 15:05:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer:sender; bh=Jz/CS/6xQ1aWWvDQx/jsGm2eEh4jc1Lr/OqLHLxwqYw=; b=l265ykvfwTrqT+G6QgSMS91aS/30oB1ziTJ6mGUD6xM7LtM/QKio4SiEseo1UTHIgRWBgUKGNCH6K9MBWd+51OphpvJpQBA9NjZyJWv3GoCPdYt/xwL7JDaVEC2h/ya2FceTie4EZMd4AZWrS8UkzkCVk0q8y2uv+RA+Vze+t7k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer:sender; b=D4ovBNGQagLud/ptbWT2LI6Lmq2GRB2sBC7ATuUDcKNU4dthl9VPat31FrgNRrvyxqd7tC/8AsEP5H6FJbS4uFrT/jQ+2xZ3Sue7pEyf9Xibed/cMXXl+FcEFYewSKQzNwoPQtYFaA3SZYVcWYdY0/YsDn5iXpIUZcgld4Mm2Gc= Received: by 10.141.23.7 with SMTP id a7mr1582842rvj.1196895920801; Wed, 05 Dec 2007 15:05:20 -0800 (PST) Received: from viewstation.beasys.com ( [12.130.3.100]) by mx.google.com with ESMTPS id k14sm41094rvb.2007.12.05.15.05.19 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Dec 2007 15:05:20 -0800 (PST) Message-Id: <6F5C2901-BE53-48E9-A13F-B29FCF08DF01@apache.org> From: Marc Prud'hommeaux To: users@openjpa.apache.org In-Reply-To: <47572D46.7000702@spree.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Re: update query syntax for embedded class field Date: Wed, 5 Dec 2007 15:05:10 -0800 References: <0D1719326D64BD4E9F92A0C12023767804421A56@eserv.covergence.com> <47572D46.7000702@spree.de> X-Mailer: Apple Mail (2.915) Sender: Marc Prud'hommeaux X-Virus-Checked: Checked by ClamAV on apache.org I think we might only support setting top-level attributes, but you are right: it does look like we are supposed to support navigation through an arbitrary number of 1-1 relations. On Dec 5, 2007, at 2:59 PM, Michael Bouschen wrote: > 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 >