• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Custom EOSortOrdering for a WODisplayGroup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom EOSortOrdering for a WODisplayGroup


  • Subject: Re: Custom EOSortOrdering for a WODisplayGroup
  • From: Mark Wardle <email@hidden>
  • Date: Thu, 6 May 2010 13:13:02 +0100

I've done this for broken legacy data.

My getter does more than a simple cast - it returns the number from the string with non numerical digits removed. Therefore it is guaranteed to return a numerical value.

In fact, because my hosipital identifiers frequently have letters before and after, to deal with sorting I convert the letters to two numbers which are subsequently converted to the moat or least significant numbers. As such. A00002 comes before B00001 and most importantly, A00010 comes after A00005!


-- Dr. Mark Wardle Specialist registrar, Neurology (Sent from my mobile)


On 6 May 2010, at 12:21, Paul Hoadley <email@hidden> wrote:

Hi Mark,

On 06/05/2010, at 8:33 PM, Mark Wardle wrote:

This may be naive but could you create a derived property and sort on that?

Presumably this could be java based for in memory sorts or implemented within your database if db sorts were required?

That's what I am doing as a work-around while the identifiers are known just to contain numbers (in a string attribute). I just cast the strings to integers, and sort in the conventional way. That will break if and when the attribute contains a value that can't be cast to an integer. I suppose I could extend that: instead of casting to an integer, pad the strings with '0's. In any case, I just wondered if there was a more WO way to do it, but I suspect I misunderstood how EOSortOrderings worked, as I described in my previous post.



-- Paul.

http://logicsquad.net/


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Custom EOSortOrdering for a WODisplayGroup (From: Paul Hoadley <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Johann Werner <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Paul Hoadley <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Timo Hoepfner <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Paul Hoadley <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Mark Wardle <email@hidden>)
 >Re: Custom EOSortOrdering for a WODisplayGroup (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: Custom EOSortOrdering for a WODisplayGroup
  • Next by Date: Re: Switch from 5.3.3 to 5.4.3 breaks tomcat deployment
  • Previous by thread: Re: Custom EOSortOrdering for a WODisplayGroup
  • Next by thread: Re: Custom EOSortOrdering for a WODisplayGroup
  • Index(es):
    • Date
    • Thread