Re: Sorting strings numerically

From: Aristedes Maniatis (ar..aniatis.org)
Date: Fri Sep 24 2010 - 00:53:42 UTC

  • Next message: Tomas Stenlund: "Exception in Cayenne Modeler, heap blows up"

    On 24/09/10 7:43 AM, Marek Šabo wrote:
    > sorry, my first post was probably confusing.
    > I could do it programmatically but I want to know if it is possible with
    > cayenne sorting engine, paraphrased, Can I modify sort order property
    > for cayenne somehow, e.g. as MySQL function INET_ATON()?
    >
    > Meanwhile I can create a template query:
    >
    > SELECT ipAddress FROM Ip4Address ORDER BY
    > INET_ATON(Ip4Address.ipAddress) ASC

    There is no such thing as the "cayenne sorting engine". Cayenne does its sorting by creating SQL commands to send to the database. Your approach, sorting in by formula inside the database, is probably the best. It is potentially very slow since I don't think you can create an index on a formula inside mysql.

    Ari

    -- 
    -------------------------->
    Aristedes Maniatis
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
    



    This archive was generated by hypermail 2.0.0 : Fri Sep 24 2010 - 00:54:27 UTC