Re: Relationship & Sort Ordering

From: Joe Baldwin (jfbaldwi..arthlink.net)
Date: Fri Feb 19 2010 - 15:42:56 EST

  • Next message: camone: "change catalog in runtime"

    Hi Andrey,

    > Proposal link:
    > http://markmail.org/message/6psmcz6zfcb6fj7g

    Yes this is exactly what I was thinking of!

    "but this will not work for flattened rels. So we'll need either add orderings for each component of the path (I don't like this way) or add orderings for DbRels as well:
            DbRelationship paintingsArray = ...
            paintingsArray.addOrdering(new Ordering("PAINTING_NAME",
            SortOrder.ASCENDING)); //notice db attr name

    Then Obj rel will automatically pick orderings from underlying Db Rel(s)"

    I am not completely following your comment about the flattened relationship. Howeve, IMHO it seems logical to implement any SelectQuery/SQL customization as an extension of the DbRelationship (as you comment) and also allow it to be added via the CayenneModeler (so that webapps with variable entry points will be supported).

    Thanks for your help,
    Joe

    On Feb 19, 2010, at 3:21 PM, Andrey Razumovsky wrote:

    > Proposal link:
    > http://markmail.org/message/6psmcz6zfcb6fj7g
    >
    > 2010/2/19 Andrey Razumovsky <razumovsky.andre..mail.com>
    >
    >> Hi,
    >>
    >> Unfortunately this is not yet supported. See
    >> http://issues.apache.org/jira/browse/CAY-477.
    >> You'll need to order list every time it is returned (e.g. using
    >> Ordering.orderList())
    >>
    >> 2010/2/19 Joe Baldwin <jfbaldwi..arthlink.net>
    >>
    >> I need to sort-order a list returned from a to-many relationship. It is
    >>> logical that this ordering be applied in all cases.
    >>>
    >>> Question:
    >>> Is there a simple way to apply this by modifying the SelectQuery
    >>> associated with the relationship or should I just sort order the list each
    >>> time it is returned?
    >>>
    >>> (If I missed it in the docs please send me a link.)
    >>>
    >>> Thanks,
    >>> Joe
    >>>
    >>>
    >>
    >>
    >> --
    >> Andrey
    >>
    >
    >
    >
    > --
    > Andrey



    This archive was generated by hypermail 2.0.0 : Fri Feb 19 2010 - 15:43:34 EST