Re: Sorting Relationships

From: Eric Schneider (eri..entralparksoftware.com)
Date: Thu Jun 30 2005 - 09:45:22 EDT

  • Next message: Dhruti Ramani: "Re: Sorting Relationships"

    Kevin,

    Typically I've override the relationship method in my Object Entity
    subclass.

    Something like:

         public List getMyRelationshipList() {

                 List list = super.getMyRelationshipList();

                 if (list.size() == 0) return list;

                 List orderings = new ArrayList();
                 orderings.add(new Ordering("property1", Ordering.DESC));
                 orderings.add(new Ordering("property2", Ordering.DESC));

                 Ordering.orderList(list, orderings);

                 return list;
         }

    Hope that helps.
    Cheers,
    e.

    On Jun 30, 2005, at 9:33 AM, Kevin Menard wrote:

    > I'm quite certain I've actually seen this question and answer
    > before, but I couldn't find it anywhere. So, I'm taking the
    > liberty of asking it again :-)
    >
    > Is it possible to specify an ordering for records fetched as part
    > of a relationship?
    >
    > --
    > Kevin
    >



    This archive was generated by hypermail 2.0.0 : Thu Jun 30 2005 - 09:45:27 EDT