Adding a filter to a D2J fetch
Adding a filter to a D2J fetch
- Subject: Adding a filter to a D2J fetch
- From: Ray Ackland <email@hidden>
- Date: Sun, 28 Sep 2003 21:46:15 +1200
I have a suspicion from several unanswered questions regarding D2J,
that not a lot of people on this list actually develop using it. But
I'll keep my fingers crossed that this next one can be answered. I will
also try posting on some other help groups.
My application in development involves staff members, many clients, and
tracks many more interactions between these two entities. As a result
when I open a staff member window (which lists these interactions) it
takes a long time to load all the extra info (dating back several
years).
I am trying (obviously with little success) to limit the interactions
retrieved to some subset based on a time frame / client still active
etc. I don't want to use the qualifier in the EOModel as there will be
several possible selections happening.
My attempt was to alter the method clientTime() - the one which
currently returns all the related records - as follows:
public NSArray clientTimes()
{
NSLog.out.appendln("step 1");
EOEditingContext ec = new EOEditingContext();
NSLog.out.appendln("step 2");
EOFetchSpecification fs =
EOFetchSpecification.fetchSpecificationNamed("activeAsCaseManager",
"ClientTime");
NSLog.out.appendln("step 3");
return ec.objectsWithFetchSpecification(fs);
}
For some reason, none of the NSLog outputs are appearing in the console
(and I am getting a Java null pointer exception occurring).
The (slightly altered) original method (below) does output the "step 1".
public NSArray clientTimes()
{
NSLog.out.appendln("step 1");
return (NSArray)storedValueForKey("clientTimes");
}
I don't know if I need to use the session's default editing context,
but even if so, why aren't I getting any console output in the modified
version? I have also carefully checked that the entity name and fetch
specification in the EOModel are correctly typed (current fetch
specification is not to filter anything yet).
I can't step through the code as the debugger doesn't seem to want to
play ball (I have checked the usual problem case of Java debugger not
being selected).
I am developing on Mac OS X 10.2.6, Java 1.4.1 (linked back to 1.3.1),
WO 5.2.1.
Any and all help gratefully accepted.
Ray.
_______________________________________________
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.