Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 10337 invoked from network); 19 Sep 2009 14:57:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Sep 2009 14:57:09 -0000 Received: (qmail 37671 invoked by uid 500); 19 Sep 2009 14:57:09 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 37639 invoked by uid 500); 19 Sep 2009 14:57:08 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 37629 invoked by uid 99); 19 Sep 2009 14:57:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Sep 2009 14:57:08 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [196.25.240.239] (HELO rrba-ip-smtp-1-2.saix.net) (196.25.240.239) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Sep 2009 14:57:00 +0000 Received: from [192.168.0.19] (dsl-241-224-147.telkomadsl.co.za [41.241.224.147]) by rrba-ip-smtp-1-2.saix.net (Postfix) with ESMTP id 1E79B1951 for ; Sat, 19 Sep 2009 16:56:35 +0200 (SAST) Message-ID: <4AB4F11F.5080207@stimulussoft.com> Date: Sat, 19 Sep 2009 16:56:31 +0200 From: Jamie User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: user@cayenne.apache.org Subject: Re: Relationships Not Propagated References: <4AB1E964.8030202@stimulussoft.com> <5adb61290909170705x49ffddfam8407b0f3b15599dc@mail.gmail.com> <4AB33DD3.3060805@stimulussoft.com> <5adb61290909180626r6a6d6463kf22f1b52bb654c0@mail.gmail.com> <4AB39409.5060706@stimulussoft.com> <5adb61290909180729w1cb7a0ecga5f30498afb7e871@mail.gmail.com> In-Reply-To: <5adb61290909180729w1cb7a0ecga5f30498afb7e871@mail.gmail.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 Michael Next question. I am trying to execute a query like: select distinct customer.companyName c, max(date) d from purchase inner join customer on purchase.customerid = customer.id group by customer.companyName" In doing so, I figured out I might need to use the SQLResultSetMapping class to get at c and d, but this class does exist in the latest cayenne-server-3.0M6.jar. What is the recommended approach? Thanks Jamie Michael Gentry wrote: > I took a quick look at your model and it looks OK (given what I know > about what you are doing). > > One thing that may be worth trying is to change: > > Partner partner = > ((BusinessServicesPrincipal)request.getUserPrincipal()).getPartner(); > DataContext context = > ((BusinessServicesPrincipal)request.getUserPrincipal()).getDataContext(); > Customer customer = (Customer) context.newObject(Customer.class); > > to: > > Partner partner = > ((BusinessServicesPrincipal)request.getUserPrincipal()).getPartner(); > Customer customer = partner.getDataContext().newObject(Customer.class); > > It may not solve anything, but worth a shot. I'm assuming you are > using Cayenne 3.x? >