Re: Getting rows in right order from Database

From: Neil Pierson (neil.pierso..mail.com)
Date: Mon Nov 07 2005 - 14:21:31 EST

  • Next message: Neil Pierson: "Re: Getting rows in right order from Database"

    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 <dhrutiraman..ahoo.com> 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.<http://us.lrd.yahoo.com/_ylc=X3oDMTFqODRtdXQ4BF9TAzMyOTc1MDIEX3MDOTY2ODgxNjkEcG9zAzEEc2VjA21haWwtZm9vdGVyBHNsawNmYw--/SIG=110oav78o/**http%3a//farechase.yahoo.com/>
    >
    >



    This archive was generated by hypermail 2.0.0 : Mon Nov 07 2005 - 14:21:33 EST