cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: SelectQuery and new objects
Date Mon, 19 May 2008 20:26:48 GMT
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 <dlatt@alqualonde.de> 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 <dlatt@alqualonde.de> 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?
>  > >
>  > >
>
>

Mime
View raw message