ok i will try that but what I dont understand is how cayenne returns a list? In what orders it returns, last modified object first, first entered first out or what?
Andrus Adamchik <andru..bjectstyle.org> wrote:For now if you really need to tweak how relationship is fetched, you
may have to use a custom query and store returned list as an ivar
somewhere instead of relying on default relationship logic.
The other option that Neil mentioned (IndexPropertyList) is not yet
available for DataContext... But it will be soon.
Andrus
On Nov 7, 2005, at 11:26 PM, Dhruti Ramani wrote:
> Thanks for replying. I was aware of this but when we have a query
> that returns large number of rows then its not a good idea to get
> the list and then sort it.
>
> Thanks,
> Denna
>
> Neil Pierson wrote:
> To the best of my knowledge, relationships do not return objects
> with an order. You can do something like this:
>
> List list = someObject.getRelatedObjects;
> Ordering ord = new Ordering
> (RelatedObjects.SOME_PROPERTY, Ordering.ASC);
> ord.orderList(list);
>
> On 11/7/05, Dhruti Ramani wrote:
> I am using cayenne1.1 and Postgresql as my database. I have two
> objects Address and USState and 1 to M relation between them. Every
> time i print a list of USStates it prints in different order, like
> sometime NY, NJ, and sometime NJ, NY. I am not using any Ordering.
> Is there a way to tell cayenne that get the list in some order? For
> getting the list i am using method that cayenne provides.
>
> Thanks,
> Denna
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
This archive was generated by hypermail 2.0.0 : Mon Nov 07 2005 - 16:11:58 EST