Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 32795 invoked from network); 19 May 2008 20:27:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 May 2008 20:27:27 -0000 Received: (qmail 52925 invoked by uid 500); 19 May 2008 20:27:28 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 52912 invoked by uid 500); 19 May 2008 20:27:28 -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 52901 invoked by uid 99); 19 May 2008 20:27:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 May 2008 13:27:28 -0700 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 mkienenb@gmail.com designates 74.125.46.158 as permitted sender) Received: from [74.125.46.158] (HELO yw-out-1718.google.com) (74.125.46.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 May 2008 20:26:42 +0000 Received: by yw-out-1718.google.com with SMTP id 6so1279541ywa.82 for ; Mon, 19 May 2008 13:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=IFkvUzZbeuiLAV2cNUQdbL+X0K1KIVEN3dTOlCWUAqw=; b=AzX/WSHle9p8MgmHsCmmvfXoJqaMcJZQn28eYUASyA5pt8Iww9RkZvigvj3Tl+JQwHRrL01zlLt9OWny+WnOLf3RlA9IRcB83gEgMnVl3uQ4Nw0XNy9/7399aVd7LOtDB6m9GrUH19Qcxs7NPOTGYLPEXDMCjLohDXeco3Rt6a4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iOmZo5QQlJx98jB/H9qYZJ4myaLwHh0Cv+sQVXnUaPJRu8Cs4+guEUxQGz59u8oKwslgDRuNhMr46BTV202rGhV9loYmb5Q7B+nCklrZOiluMwxG+JJx97N5aIREPhwkLF0hzpPzJzzIRUKP0jVHYvxzhOTEh25g3EcHr055Ero= Received: by 10.150.11.1 with SMTP id 1mr6881983ybk.6.1211228808707; Mon, 19 May 2008 13:26:48 -0700 (PDT) Received: by 10.151.98.13 with HTTP; Mon, 19 May 2008 13:26:48 -0700 (PDT) Message-ID: <8f985b960805191326x2b389c6avc2e0b9b21211a6b1@mail.gmail.com> Date: Mon, 19 May 2008 16:26:48 -0400 From: "Mike Kienenberger" To: user@cayenne.apache.org Subject: Re: SelectQuery and new objects In-Reply-To: <1211227179.16196.33.camel@dinu.dlnetz> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1211224602.16196.13.camel@dinu.dlnetz> <1DE6AD08-4BE3-42D6-93D9-E7A45CA8EC34@puregumption.com> <1211225379.16196.18.camel@dinu.dlnetz> <8f985b960805191234g848b8c3r634cef57ecd340ca@mail.gmail.com> <1211227179.16196.33.camel@dinu.dlnetz> X-Virus-Checked: Checked by ClamAV on apache.org You can use Expression.filterObject() to apply an expression to a set of in-memory objects, such as the results of newObjects(). I had forgotten about that functionality until you mentioned "filtered by hand", but that's going to be close to SelectQuery behavior. On 5/19/08, Dirk Lattermann wrote: > Am Montag, den 19.05.2008, 15:34 -0400 schrieb Mike Kienenberger: > > > It's true for all queries, but you can always ask the ObjectContext or > > DataContext for the list of new objects: > > > > public interface ObjectContext extends Serializable { > > > > /** > > * Returns a collection of objects that are registered with this > > ObjectContext and > > * have a state PersistenceState.NEW > > */ > > Collection newObjects(); > > > Ok, thanks. > This always returns all new objects, though. So it seems they must be > filtered by hand to get something like the result of a qualified query. > > Thank you anyway, > > Dirk > > > > On 5/19/08, Dirk Lattermann wrote: > > > Am Montag, den 19.05.2008, 14:20 -0500 schrieb Robert Zeigler: > > > > > > > The select query is going to run against data in the database, and > > > > will therefore /not/ return newly created but as yet uncommitted > > > > objects. > > > > > > > > > > > > > Aha, thank you! Is this true for all Query classes in Cayenne? In other > > > words, is there a Query (or some other means) to fetch uncommitted > > > objects? > > > > > > > >