db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert S. Sfeir" <rob...@codepuccino.com>
Subject Re: Sorting Child Objects
Date Sun, 06 Feb 2005 20:47:09 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Never mind, I changed and used List and all is OK now it sorts as 
expected.

I think perhaps OJB should throw an exception if we have orderby on a 
collection and the collection is not sortable.  Otherwise it looks like 
OJB has a bug.

R

On Feb 6, 2005, at 1:26 PM, Robert S. Sfeir wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jacob, I tried adding orderby to at least have a default sort for 
> collections...  it does nothing, the order is wrong.  I added 
> orderby="order" which is the field name in the referenced collection, 
> the sort is not even close, either there's a bug (and I should dig 
> into it) or I didn't understand how to use it.
>
> R
>
> On Feb 6, 2005, at 3:58 AM, Jakob Braeuchi wrote:
>
>> hi robert,
>>
>> have you tried the orderby in collection-descriptor ?
>>
>> jakob
>>
>> Robert S. Sfeir schrieb:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>> Either I'm rusty or this is a little trickier to do...
>>> The issue is that I have a TicketType, which has a Collection of 
>>> Attribute which itself has a Collection of AttributeType.
>>> When I do a select for a Collection of Attribute(s) for a TicketType 
>>> (select * from ticket_types tt, attributes a  where ticket_type=1 
>>> and tt.type_id = a.type_id order by a.attribute_order) I get a 
>>> TicketType with its Attribute Collection and the Attribute 
>>> Collection is correctly sorted by the order column.  But I need to 
>>> take this a step further because an Attribute has a Collection of 
>>> AttributeValue(s), and I want those AttributeValue objects to also 
>>> be sorted by a specific column.
>>> In other words I need the 3rd IN query that OJB triggers to get the 
>>> AttributeValue to be sorted...
>>> What's the most efficient way to do this?  I'd rather not do 2 
>>> selects myself, I like having one select and have OJB deal with the 
>>> prefetched relationships... and sorting...
>>> I have another example which goes deeper from project to tickettype 
>>> etc...
>>> Thanks
>>> R
>>> -----BEGIN PGP SIGNATURE-----
>>> Version: GnuPG v1.2.4 (Darwin)
>>> iD8DBQFCBVhrJhqny0eCHK8RAvnjAJ0ZxKTArcUkJyxQlBZJ36JuEWOg5wCfXiCP
>>> 56Ietiiuhj5oIMVgHTFepT8=
>>> =WJoc
>>> -----END PGP SIGNATURE-----
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (Darwin)
>
> iD8DBQFCBmFfJhqny0eCHK8RAgegAJ98vIxFDOi7w1nNE0HrAYjnQ+KfYwCfZ4Te
> CeJ29I/wlx8Q1DWNWcWVQg8=
> =iode
> -----END PGP SIGNATURE-----
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCBoJNJhqny0eCHK8RArL2AJwPRof7V/8oNFw4Iw/Ge3d1BOsy2gCbBEXg
wd75oDkNah8YRcvXzLVmejE=
=CQar
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message