VW7.6 Glorp. How order anwers by toMany values

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

VW7.6 Glorp. How order anwers by toMany values

vam
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW7.6 Glorp. How order anwers by toMany values

Alan Knight-2
This seems difficult to do. The relational database does not have a concept of "first". So you can't easily tell it which of the property types you want to order by. You could write

query := Query read: Item where: [:each | ...  ].
query orderBy: [:each | each properties type].

which should work, but will have many duplicates of the items, one for each property that they have. Normally if you put in something like an alsoFetch: #properties then it would avoid the duplicates because it will see them coming back and condense duplicates. But if we've set the sort order to make them occur at different places in the result set then this won't work.

At 05:42 PM 3/26/2009, VAM wrote:

>I have object Item. Item consists collection of instances ItemProperty.
>ItemProperty has instance variables type and value.
>In DescriptorSystem relation between Item and ItemProperties is
>ToManyMapping.
>
>How build query for read Item order by type and value?
>Wrong code, but illustrated
>
>glorpSession readManyOf: Item where: [:each | each properties first type]
>--
>View this message in context: http://www.nabble.com/VW7.6-Glorp.-How-order-anwers-by-toMany-values-tp22731705p22731705.html
>Sent from the VisualWorks mailing list archive at Nabble.com.
>
>_______________________________________________
>vwnc mailing list
>[hidden email]
>http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

--
Alan Knight [|], Engineering Manager, Cincom Smalltalk
[hidden email]
[hidden email]
http://www.cincom.com/smalltalk

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
vam
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW7.6 Glorp. How order anwers by toMany values

vam
CONTENTS DELETED
The author has deleted this message.
vam
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW7.6 Glorp. How order anwers by toMany values

vam
CONTENTS DELETED
The author has deleted this message.