Where clause filtering by FilteredTypeResolver column

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Where clause filtering by FilteredTypeResolver column

Esteban A. Maringolo
I want to perform a query filtering the results based on the
attribute/column used as key of the FilteredTypeResolver. But
apparently I can't.

QuestionAnswer references Question, which is the root abstract class
of a hierarchy of questions, and also the root of the
FilteredTypeResolver, using the #qtype and 'qtype' columns.
Each concrete subclass of question implements #qtype.

Ej:
Question
  \__ BooleanQuestion>>#qtype -> "boolean"
  \__ NumericQuestion>>#qtype -> "numeric"
     \__ PercentageQuestion>>#qtype -> "percentage"

... and so on.

I want to perform something like:
query := Query read: QuestionAnswer where: [:each | each question
qtype = NumericQuestion qtype ].

But it seems that because QuestionAnswer references Question (the
abstract class) in its #question mapping/attribute, the #qtype can't
be resolved, because it is a filtering column (which apparently has a
different treatment).

Can this be performed?

Thank you!

Esteban A. Maringolo

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Where clause filtering by FilteredTypeResolver column

jtuchel
Esteban,

Did you try adding a "normal" mapping for the column qtype?

Joachim

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Where clause filtering by FilteredTypeResolver column

Esteban A. Maringolo
In reply to this post by Esteban A. Maringolo
Answering myself...

I added the following to the Question descriptor, and it works!

((aDescriptor newMapping: DirectMapping) from: #qtype to: (aDescriptor
table fieldNamed: 'qtype'))
beForPseudoVariable

Thanks in advance.


Esteban A. Maringolo

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.