Re: Ordering on non-database field

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue May 27 2003 - 02:02:28 EDT

  • Next message: Merritt, Scott: "Recommended method of using/getting to PK IDs"

    On Monday, May 26, 2003, at 12:03 PM, John Poole wrote:

    > I've added an Integer field to the class that extends my database
    > object, and I'm passing its name to the Ordering class. It does the
    > sort, but returns the List ordered alphabetically instead of
    > numerically.
    > Should I just be using a java Collection to do this or is there a way
    > to
    > define the field so that it will work properly with the Ordering class?

    I just added a few unit tests showing that sorting in-memory with
    Ordering class on an Integer non-persistent properties actually works
    fine. So my guess is that you are running Cayenne ca. Alpha 6 - back
    then there was a bug in CayenneDataObject.readNestedProperty() method
    that did not recognize non-persistent properties. It was fixed quiet
    some time back, though for such extra properties "readNestedProperty"
    will use bean introspection, making it rather slow.

    > Good work on getting beta 3 out, you're delivering on all the
    > development promises we're making to others.

    Yeah, this whole CLOB/BLOB thing was a real mess indeed. :-)

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue May 27 2003 - 02:01:36 EDT