• 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: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)


  • Subject: Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)
  • From: Johann Werner <email@hidden>
  • Date: Thu, 15 Mar 2012 20:09:22 +0100

One case where the PK comes in handy is when using batched displaygroups and batched fetch specifications. I tend to add to any present (DB) sort ordering the id key to make the result set of the database deterministic. Otherwise I had sometimes the effect of getting some objects on multiple/different batches.

jw


Am 15.03.2012 um 19:54 schrieb Ramsey Gurley:

>
> On Mar 15, 2012, at 11:46 AM, Chuck Hill wrote:
>
>>
>> On 2012-03-15, at 11:41 AM, Ramsey Gurley wrote:
>>>
>>> Dave A's point still stands though.  The ID is unique, but not necessarily in any particular order.  I'd go with a dateCreated column populated in willInsert() or init().  Using the pk to determine the date created is just sloppy and will come back to haunt Rich one day.  If Rich wants something that's easy to sort with JSON, then I would suggest formatting the date as a value that sorts easily and send that down to the client.  YYYY-MM-DD, date.getTime() or something.
>>
>>
>> I agree.  Using the PK as anything other than a fully meaningless "that one" indicator is doing to bite you.  Hard.  I just don't see the point of creating a second meaningless key to hide the first meaningless key (PK).
>>
>>
>> Chuck
>
> Uh oh... I think we both just agreed with Dave A!
>
> (^_^)
>
> Ramsey



 _______________________________________________
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: 
 >ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: Rich <email@hidden>)
 >Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: Rich <email@hidden>)
 >Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: Rich <email@hidden>)
 >Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: Paul Hoadley <email@hidden>)
 >Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: Rich <email@hidden>)
 >Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: David Avendasora <email@hidden>)
 >Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: Kieran Kelleher <email@hidden>)
 >Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: Ramsey Gurley <email@hidden>)
 >Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK) (From: Ramsey Gurley <email@hidden>)

  • Prev by Date: Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)
  • Next by Date: Re: Community Roadmap for 2012
  • Previous by thread: Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)
  • Next by thread: Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)
  • Index(es):
    • Date
    • Thread