You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Joe Baldwin <jf...@earthlink.net> on 2008/09/03 19:43:22 UTC

Result Set Filters?

Lets say that I might want to filter my result set by eliminating  
certain entries.  What is the recommended (i.e. best practice) method  
of filtering the result set so that you can produce a Java List that  
is a subset of the original result set?

I would like to accomplish this in much the same way as sort-ordering  
a result-set.

BTW, the reason I want to do this is that the SQL filter would be  
complex when compared with Java List processing.



Re: Result Set Filters?

Posted by Joe Baldwin <jf...@earthlink.net>.
Thanks; that is it!  I figured Cayenne could do it, I just couldn't  
find the example.


On Sep 3, 2008, at 2:02 PM, Aristedes Maniatis wrote:

>
> On 04/09/2008, at 3:43 AM, Joe Baldwin wrote:
>
>> Lets say that I might want to filter my result set by eliminating  
>> certain entries.  What is the recommended (i.e. best practice)  
>> method of filtering the result set so that you can produce a Java  
>> List that is a subset of the original result set?
>
> You can use Cayenne expressions to filter a list in memory.
>
> http://cayenne.apache.org/doc/in-memory-evaluation.html
>
>
> Ari Maniatis
>
>
> -------------------------->
> ish
> http://www.ish.com.au
> Level 1, 30 Wilson Street Newtown 2042 Australia
> phone +61 2 9550 5001   fax +61 2 9550 4001
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>
>


Re: Result Set Filters?

Posted by Aristedes Maniatis <ar...@ish.com.au>.
On 04/09/2008, at 4:26 AM, Joe Baldwin wrote:

> do you know if result sets can be combined?

They are simply Java Collections. Combine them as you would any  
regular list. Nothing special you need to do.

Ari



-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A



Re: Result Set Filters?

Posted by Joe Baldwin <jf...@earthlink.net>.
Ari,

do you know if result sets can be combined?

Joe


On Sep 3, 2008, at 2:02 PM, Aristedes Maniatis wrote:

>
> On 04/09/2008, at 3:43 AM, Joe Baldwin wrote:
>
>> Lets say that I might want to filter my result set by eliminating  
>> certain entries.  What is the recommended (i.e. best practice)  
>> method of filtering the result set so that you can produce a Java  
>> List that is a subset of the original result set?
>
> You can use Cayenne expressions to filter a list in memory.
>
> http://cayenne.apache.org/doc/in-memory-evaluation.html
>
>
> Ari Maniatis
>
>
> -------------------------->
> ish
> http://www.ish.com.au
> Level 1, 30 Wilson Street Newtown 2042 Australia
> phone +61 2 9550 5001   fax +61 2 9550 4001
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>
>


Re: Result Set Filters?

Posted by Aristedes Maniatis <ar...@ish.com.au>.
On 04/09/2008, at 3:43 AM, Joe Baldwin wrote:

> Lets say that I might want to filter my result set by eliminating  
> certain entries.  What is the recommended (i.e. best practice)  
> method of filtering the result set so that you can produce a Java  
> List that is a subset of the original result set?

You can use Cayenne expressions to filter a list in memory.

http://cayenne.apache.org/doc/in-memory-evaluation.html


Ari Maniatis


-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A