Re: Filtering array returned by an EO's relationship (D2J)
Re: Filtering array returned by an EO's relationship (D2J)
- Subject: Re: Filtering array returned by an EO's relationship (D2J)
- From: Ricardo Strausz <email@hidden>
- Date: Mon, 3 Nov 2003 15:39:24 -0600
No, no. I did not make my self clear...
I was thinking on the db as the Server and the applications as the
Client.
I think Ray is doing WOApps (are you?).
What problem do you see in using auxliaryQualifers??
with a couple of lines, you can make your app perform much more
efficient, I think.
Dino
On lunes, novi 3, 2003, at 14:42 America/Mexico_City,
email@hidden wrote:
I must confess I haven't done any Java client stuff, so I don't know
how
that works. I missed that Java client was involved, so I have even less
expertise invovled. EOQualifier.filteredArrayWithQualifier is just Java
code; if you can execute arbitrary Java code on the server-side to
give
you an array of EO's that you will return back to the client side, then
you could include filteredArrayWithQualifier, of course. But I have
no
idea how EO's are normally transferred from the client to server; if
using an EODatasource is generally neccesary for that, then of course
that would be a good reason to use one.
--Jonathan
On Mon, 3 Nov 2003 13:48:51 -0600 Ricardo Strausz wrote:
As far as I understud the Ray's problem, the problem is precicely to
make tons of objects to travel the net, while there are only a few of
them neaded in the client side; so doing the filter on the server is
intended. Here is where an auxiliaryQualifier comes in play.
The filteredArrayWithQualifier method works on the client, right?
Dino
On lunes, novi 3, 2003, at 13:36 America/Mexico_City,
email@hidden wrote:
Personally, I think dealing with all that EODatasource stuff is the
wrong
path to be going down, unless you are ALREADY using a WODisplayGroup
for
your UI, in which case you may already have/need one. I'm not
familiar
with WODisplayGroups myself.
But if the question at hand is about filtering relationships in
general... there are simpler ways of executing code to filter the
relationship, that don't involve an EODatasource. You can just use
EOQualifier.filteredArrayWithQualifier to filter an array in-memory.
There's no need to mess around with with WODisplayGroup/EODatasource
just
to do an in-memory filter. You can just do it manually yourself in a
few
lines of code, without instantiating all those unneccesary objects.
The hard part about filtering a relationship is dealing with caching
for
efficiency and invalidating that cache when changes occur. And I
don't
_think_ this EODatasource/WODisplayGroup stuff will help with that.
But,
like I said, I'm not too familiar with them, so I could be wrong. If
they
do help with that, it could be just the thing. But if all you are
using
them for is another way of doing
EOQualifier.filteredArrayWithQualifier... it's just a big pain in the
neck for little value.
--Jonathan
On Mon, 3 Nov 2003 13:00:25 -0600 Ricardo Strausz wrote:
Sorry... I forgot you are dealing with a relation; in such a case,
you
may prefere to use a
EODetailDataSource instead. You initialize it with:
ds = EODetailDataSource(theMasterDataSource, theKey);
To get theMasterDataSource, you can use the previous example.
HIH
Dino
On lunes, novi 3, 2003, at 11:39 America/Mexico_City, Ricardo
Strausz
wrote:
Hola Ray!
There are, basically, two ways to get an EODatabaseDataSource:
* the ease, to ask for to a DisplayGroup (it may be a
EODisplayGroup,
if you work with EOInterface, or a WODisplayGroup, in a WOApp);
simply
ds = displayGroup.dataSource();
* the pro, to initialize it with
ds = EODatabaseDataSource(anEditingContext, anEntityName).
After you have one, simply use
ds.setFetchSpecification(aFetchSpecification);
ds.setAuxiliaryQualifier(aQualifier);
anArray = ds.fetchObjects();
Read:
file:///Developer/Documentation/WebObjects/Reference/API/index.html
(recall, EODataSource is defined in EOControl).
Suerte!
Dino
On sabado, novi 1, 2003, at 06:36 America/Mexico_City, Ray Ackland
wrote:
Dino,
Ok. I give up. I have been reading through the API doc's, and
generally going around in circles. I would like to have a go at
using
the auxiliary qualifier, but from what I have learnt, I first need
to
get hold of the EODatabaseDataSource in question.
And I believe I can get that from the
WOToManyRelationship.datasource() method. But how do I get the
WOToManyRelationship?
I see I can get an array of to-many relationships, but this is not
necessary as I already know the key for the relationship I want.
But
how do I get that relationship from that key?
Please point me in the right direction. As usual, the answer will
be
obvious once I know what it is.
Ray.
On Wednesday, Oct 29, 2003, at 07:34 Pacific/Auckland, Ricardo
Strausz
wrote:
Did you try dataSource.setAuxiliaryQualifier(aQualifier);
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.