Adding own ordering algorithm

From: Adrian Wiesmann (awiesman..omap.org)
Date: Sun Nov 16 2008 - 12:30:38 EST

  • Next message: Juergen Saar: "Re: Adding own ordering algorithm"

    Hello all

    I have a field in a DataObject which I need for ordering and which is
    formatted like this:

    <number>.<number>.<number>

    When ordering with the default Java order mechanism this problem arises.
    The numbers are ordered like that (which is wrong in this context):

    10.10.10
    10.4.10
    10.9.10

    So I need to write my own comparator. Has anybody done so with Cayenne
    before and what would you declare as the best/cleanest solution to do so?
    Subclassing Ordering, extending the compare method and use that new class?

    Thanks for your comments.

    Cheers,
    Adrian



    This archive was generated by hypermail 2.0.0 : Sun Nov 16 2008 - 12:32:16 EST