You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by John Huss <jo...@gmail.com> on 2012/02/16 19:20:05 UTC

Returning unsaved records in an ObjectContext with SelectQuery

Is there a way to have a SelectQuery also return matches found in the
unsaved objects in the ObjectContext?  If not, how can I query the contents
of the ObjectContext to look for matches?

In WebObjects / Wonder, there was a property you could set on the context -
setIncludeEditingContextChanges(true) that would do this.

Thanks,
John

Re: Returning unsaved records in an ObjectContext with SelectQuery

Posted by Aristedes Maniatis <ar...@maniatis.org>.
On Fri Feb 17 09:49:49 2012, John Huss wrote:
> I've accomplished what I needed with some custom code for now.  So ignore
> this.
>
> On Thu, Feb 16, 2012 at 12:20 PM, John Huss<jo...@gmail.com>  wrote:
>
>> Is there a way to have a SelectQuery also return matches found in the
>> unsaved objects in the ObjectContext?  If not, how can I query the contents
>> of the ObjectContext to look for matches?
>>
>> In WebObjects / Wonder, there was a property you could set on the context
>> - setIncludeEditingContextChanges(true) that would do this.
>>
>> Thanks,
>> John
>>
>

We've done something similar in specific cases by subclassing 
ObjectContact and searching through the context. I agree that it would 
be nice to have a switch for this which basically enables 
http://cayenne.apache.org/doc/in-memory-evaluation.html to be added to 
the results from the database.

Ari

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Re: Returning unsaved records in an ObjectContext with SelectQuery

Posted by John Huss <jo...@gmail.com>.
I've accomplished what I needed with some custom code for now.  So ignore
this.

On Thu, Feb 16, 2012 at 12:20 PM, John Huss <jo...@gmail.com> wrote:

> Is there a way to have a SelectQuery also return matches found in the
> unsaved objects in the ObjectContext?  If not, how can I query the contents
> of the ObjectContext to look for matches?
>
> In WebObjects / Wonder, there was a property you could set on the context
> - setIncludeEditingContextChanges(true) that would do this.
>
> Thanks,
> John
>