• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: DisplayGroup/ERXFlickrBatchNavigation question - Wonder bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DisplayGroup/ERXFlickrBatchNavigation question - Wonder bug?


  • Subject: Re: DisplayGroup/ERXFlickrBatchNavigation question - Wonder bug?
  • From: "Andrew R. Kinnie" <email@hidden>
  • Date: Mon, 28 Dec 2009 13:10:00 -0500

OK, I have tried to generalize it, without changing anything significant.

Basically, the legacy architecture has a Student entity/table, a Person entity/table (which represents Adults only, NOT students), a StudentPerson entity/table which is essentially a join containing extra info not currently relevant.  There is also a Family entity/table and each Student and Person has a to-one to Family.  

Not all Person/Student combinations in a Family have a corresponding row in StudentPerson, hence to dual path to find these Persons.

The code:

    public void setSelectedSchools(NSMutableArray<School> newSelectedSchools) {
        this.selectedSchools = newSelectedSchools;

                

        if (newSelectedSchools == null || newSelectedSchools.count() == 0) {
            newSelectedSchools = schools().mutableClone();
        }
        // this should get persons who have students in the schools listed
        // i.e. family.students.activeSchools || studentPersons.student.activeSchools
        EOQualifier schoolViaStudentPersonQualifier = Person.STUDENT_PERSONS.dot(
                StudentPerson.STUDENT.dot(Student.SCHOOLS)).in(newSelectedSchools);
        EOQualifier schoolViaFamilyQualifier = Person.FAMILY.dot(
                Family.STUDENTS.dot(Student.SCHOOLS)).in(newSelectedSchools);
        EOQualifier schoolQualifier = new ERXOrQualifier(new NSArray<EOQualifier>(schoolViaFamilyQualifier, schoolViaStudentPersonQualifier));

        

        displayGroup().setQualifierForKey(schoolQualifier, schoolQualifierKey);

    }

and:

    public void setRelatedStudentsByStudentFirstName(String studentFirst){
        relatedStudentsByStudentFirstName = studentFirst;
        EOQualifier relatedStudentsByStudentFirstNameQualifier;
        if(studentFirst == null || studentFirst.equals("")){
            displayGroup().setQualifierForKey(null, relatedStudentsByStudentFirstNameQualifierKey);
        } else {
            NSMutableArray<EOQualifier>qualifiers = new NSMutableArray<EOQualifier>();
            qualifiers.add(Person.STUDENT_PERSONS.dot(StudentPerson.STUDENT).dot(Student.FIRSTNAME).like(studentFirst));
            qualifiers.add(Person.FAMILY.dot(Family.STUDENTS).dot(Student.FIRSTNAME).like(studentFirst));

            relatedStudentsByStudentFirstNameQualifier = new ERXOrQualifier(qualifiers);   
            displayGroup().setQualifierForKey(relatedStudentsByStudentFirstNameQualifier, relatedStudentsByStudentFirstNameQualifierKey);
        }

       

    }

From the log (formatted):

DG qualifier: 
(
(
(
(family.students.schools = 
(School)'<School pk:"1">') 
or (family.students.schools = 
(School)'<School pk:"2">') 
or (family.students.schools = 
(School)'<School pk:"3">') 
or (family.students.schools = 
(School)'<School pk:"4">') 
or (family.students.schools = 
(School)'<School pk:"5">') 
or (family.students.schools = 
(School)'<School pk:"6">') 
or (family.students.schools = 
(School)'<School pk:"7">') 
or (family.students.schools.Schools = 
(School)'<School pk:"8">') 
or (family.students.schools = 
(School)'<School pk:"9">') 
or (family.students.schools = 
(School)'<School pk:"10">')
) 
or 
(
(StudentPersons.Student.Schools = 
(School)'<School pk:"1">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"2">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"3">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"4">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"5">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"6">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"7">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"8">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"9">') 
or (StudentPersons.Student.Schools = 
(School)'<School pk:"10">')
)
) 
and 
(
(StudentPersons.Student.firstname like 'Hillary') 
or (samsFamily.Students.firstname like 'Hillary')
)
)


On Dec 28, 2009, at 12:53 PM, Chuck Hill wrote:


On Dec 28, 2009, at 9:06 AM, Andrew R. Kinnie wrote:

As a followup, I get the correct number of rows if I comment out any code which sorts the displayGroup using attributes other than the id column of the entity populating the displayGroup.

Without sorting, and with setUsesDistinct(true); I get 23 rows.  Navigation works.

If I then try to sort the displayGroup (using in this case the entity's lastname then firstname attributes) I get the oracle error, because the inner most select statement generated by Wonder/EOF has a distinct, but is trying to orderby attributes that are in the outermost select but not the inner most select where the distinct statement is.

Is this a bug in Wonder where setUsesDistinct(true); does not work with sorting?

Am I missing something?


What is the qualifier?  If you are using one of the Wonder qualifiers, you may have found a bug or may be using them incorrectly.


Chuck

--
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








 _______________________________________________
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

References: 
 >RE: DisplayGroup/ERXFlickrBatchNavigation question - Wonder bug? (From: "Andrew R. Kinnie" <email@hidden>)
 >Re: DisplayGroup/ERXFlickrBatchNavigation question - Wonder bug? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Stored procedure problem
  • Next by Date: Re: Stored procedure problem
  • Previous by thread: Re: DisplayGroup/ERXFlickrBatchNavigation question - Wonder bug?
  • Next by thread: Re: DisplayGroup/ERXFlickrBatchNavigation question - Wonder bug?
  • Index(es):
    • Date
    • Thread