Hi Alan,
I still don't know how to use #retrieve: but doing as you suggested
helped me reach the lowest level (ObjectD), but not ObjectE, because I
was wrong in my description, and ObjectD and ObjectE relation is not
1:1.
Putting everything in a the real context:
SurveyDefinition (ObjectA)
\_ 1:n CategorySurvey (ObjectB)
\_1:n SurveySection (ObjectC)
\_ 1:n SurveyQuestion (ObjectD)
In other hierarchy of equally composed objects, I have the "results"
for each SurveyDefinition.
SurveyResult (refs SurveyDefinition)
\_1:n CategorySurveyResult (refs CategorySurvey)
\_ 1:n SurveySectionResult (refs SurveySection)
\_ 1:n QuestionAnswer (refs SurveyQuestion)
All the above described 1:n relations are bidirectional, it is, all
levels answer it's parent when receive #owner.
And I can send #survey to any of the described classes, and they will
delegate it's resolution until they reach an object with the direct
reference to SurveyDefinition, it is SurveyResult or CategorySurvey.
If I instantiate the whole result in memory, I can do whatever I like with them.
What I'm trying is to narrow the results, querying only certain
QuestionAnswer's according to some values, but only belonging to a
particular SurveyDefinition.
E.g.:
query := Query read: QuestionAnswer where: [:each | each value > 10
AND: [each survey = aSurveyDefinition]].
Because I'm only interested in a small subset of answers (<5%), I have
thousands of QuestionAnswers, there is no point in loading the
remaining 95% just to be discarded, with all the CPU and I/O time it
means.
Also SurveyQuestion is a whole hierarchy of classes, sharing a common
table, but using a FilteredTypeResolver.
I hope it is more clear now.
There is a quick "solution" for this that I'm trying to avoid:
I can add a survey_id field to QuestionAnswer's table, and declare a
OneToOneMapping in QuestionAnswer.
Maybe it's the best, and the fastest too. But I try to unify
references as much as I can.
Regards,
--
Esteban.
> You received this message because you are subscribed to a topic in the
> Google Groups "glorp-group" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/topic/glorp-group/KRcO5pdt2Zw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to