Re: Help with ERXBatchFetchUtilities.batchFetch
Re: Help with ERXBatchFetchUtilities.batchFetch
- Subject: Re: Help with ERXBatchFetchUtilities.batchFetch
- From: Chuck Hill <email@hidden>
- Date: Fri, 17 Sep 2010 13:35:31 -0700
On Sep 17, 2010, at 1:24 PM, Paula Loehr wrote:
> Hi,
> This is my first time to post a question to this list, so let me know if I’m not providing enough information.
>
>
> Here’s my problem:
> I’m calculating students’ gpas so I can then get a student’s class rank.
> I have one “if” statement that is still causing database hits: if (this.studentCourse().course().isHighschool()) {
What is "this"?
>
> Because there could be hundreds of gpas that I’m calculating, I need to eliminate all database hits during my calculation or it will take too long.
>
> I’ve added the following batchFetch to try to eliminate these database hits and it’s not quite working yet. It’s working for some of the keyPaths, but not all.
> ERXBatchFetchUtilities.batchFetch(students, new
> NSArray<String> (new String [] {
> "transcript", <---- this one works
> "finalTranscript", <---- this one works
> "transcript.student",
> "transcript.student.schoolStudents",
> "transcript.terms", <---- this one works
> "transcript.terms.courses", <---- this one works
> "transcript.terms.courses.studentCourse",
> "transcript.terms.courses.studentCourse.course"
transcript.terms.courses.studentCourse.course matches this.studentCourse().course() above?
Chuck
> }));
>
> Here are the relationships:
> transcipt > student >> schoolStudents
> transcript >> terms >> courses > studentCourse > course
>
> Here is the data it’s fetching:
> transcript : 44 rows (correct)
> finalTranscript : I don’t see any SQL generated for this fetch
> transcript.student : or this one (there should be 44)
> transcript.student.schoolStudents : or this one (there should be 44, it’s a one to many, but it just so happens, that there’s 1 schoolStudent record for each
> student in this case)
> transcript.terms : 131 rows (correct)
> transcript.terms.courses : 1048 (correct)
> transcript.terms.courses.studentCourse : I don’t see any SQL for this one either
> transcript.terms.courses.studentCourse.course : or this one
>
>
> I’ve tried variations of the batchFetch statement and tried setting the skipFaultedSourceObjects to true and false, but I always have the same result.
>
> Any ideas?
>
> Thanks in advance,
> Paula
>
>
>
> --
> Paula Loehr
>
> K12 Inc
> 719-460-4350
> email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden