Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 96131 invoked from network); 14 Mar 2009 19:53:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2009 19:53:39 -0000 Received: (qmail 10406 invoked by uid 500); 14 Mar 2009 19:53:38 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 10393 invoked by uid 500); 14 Mar 2009 19:53:38 -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 10382 invoked by uid 99); 14 Mar 2009 19:53:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Mar 2009 12:53:38 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of robert.zeigler@gmail.com designates 209.85.132.244 as permitted sender) Received: from [209.85.132.244] (HELO an-out-0708.google.com) (209.85.132.244) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Mar 2009 19:53:29 +0000 Received: by an-out-0708.google.com with SMTP id b6so1275430ana.37 for ; Sat, 14 Mar 2009 12:53:08 -0700 (PDT) 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; bh=2k+dPFfyV9BtVPJeDvDGSsAzFZ/RNRGCp+WKxNw8cRQ=; b=eUMggw6tvHqX5vuTU9W6+ruC6bIue7qnDsS3sW9qHOHnAGjYgGv4nnsTUgUgypv2en OcyDx6ymhgPVlfyJOjaqWCErAX2Y8L6ebOeXvZ+vfIkk20b7SjsgV7t+vh3OHfVJSyYk chDonvCtz/GKy5kHHmGeh3CHhcLlCcn40MjIw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=fU8cItgtKrjFXC458qMqaHi/NP7uwC/3pp+7QMVRPr6dQWJGqPuslEM0NrnPWPnJXH U5YNP7h+29cTaf63JixNZDdxOeg6Jy8KOfPkgTQzvLWloECTC12Nv9ymm2lQ4MRmYt/V tw9oncmIlXKz24PcEgkUi6vAhydL9MWvn4aQE= Received: by 10.100.254.15 with SMTP id b15mr1766599ani.150.1237060388812; Sat, 14 Mar 2009 12:53:08 -0700 (PDT) Received: from ?192.168.0.2? (ppp-70-246-220-170.dsl.stlsmo.swbell.net [70.246.220.170]) by mx.google.com with ESMTPS id b32sm1722124ana.15.2009.03.14.12.53.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 14 Mar 2009 12:53:08 -0700 (PDT) Message-Id: <45F555BA-7356-4037-9F62-75893526E518@puregumption.com> From: Robert Zeigler To: user@cayenne.apache.org In-Reply-To: <85996577-B7D6-4904-9DD1-CD5C427FDD76@earthlink.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Qualifier Expression Date: Sat, 14 Mar 2009 14:53:05 -0500 References: <85996577-B7D6-4904-9DD1-CD5C427FDD76@earthlink.net> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org Hi Joe, How about: SelectQuery query = new SelectQuery(Entity1.class); query.setQualifier(ExpressionFactory.matchExp(Entity1.EN| TITY2_PROPERTY,entity2));//where ENTITY2_PROPERTY is the name of object property in entity1 that points to entity2 List e1 = objectContext.performQuery(query);//note: perform query is NOT generified, so you'll get a warning here. Robert On Mar 14, 2009, at 3/141:29 PM , Joe Baldwin wrote: > I am attempting to create the simplest Cayenne-expedient method of > doing the following query. (I can easily do this in SQL but am a tad > confused with the Cayenne Expression method.) > > I have an Entity (E1) with a one to one relationship with a second > entity (E2). I would like to perform a SELECT Query with a filter > on one of the fields of the relationship-entity (E2.F1) and return a > list of the first entity (E1List). > > What is the most efficient Cayenne way to do this? (I am still a > bit confused concerning how to construct efficient queries in the > object domain vs the relational domain.) > > Thanks, > Joe > > >