• 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: Order by primary key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Order by primary key


  • Subject: Re: Order by primary key
  • From: David LeBer <email@hidden>
  • Date: Thu, 12 Apr 2012 11:43:44 -0400

If you are using Wonder, ERXS is your friend:

NSArray<Address> allAddresses = Address.fetchPUPAddresses(ec, qualifier, ERXS.descs("id"));

D

--
David LeBer
Codeferous Software

On 2012-04-12, at 11:36 AM, Ken Anderson wrote:

> This worked perfectly...I know using "id" is not ideal, but it is rough fix until I can do some revision to the architecture.
>
> NSMutableArray<EOSortOrdering> ordering = new NSMutableArray<EOSortOrdering>();
> EOSortOrdering byPK = new EOSortOrdering("id", EOSortOrdering.CompareDescending);
> ordering.add(byPK);
>
> NSArray<Address> allAddresses = Address.fetchPUPAddresses(ec, qualifier, ordering);
>
> Ken Anderson
> email@hidden
>
>
>
> On Apr 12, 2012, at 8:21 AM, Chuck Hill wrote:
>
>> But I would not rely on that to get the latest object.  That is inferring meaning in the PK.  Add a timestamp and sort on that.
>>
>> Chuck
>>
>> On 2012-04-12, at 4:48 AM, Kieran Kelleher wrote:
>>
>>> In memory you can sort by "rawPrimaryKey"
>>>
>>> For a fetch spec, even if PK is not exposed as a class property, you can still use it in a sort ordering.
>>>
>>>
>>>
>>> On Apr 11, 2012, at 10:29 PM, Ken Anderson wrote:
>>>
>>>> Is there a way to sort a fetch result by primary key? I just need to access the latest object (order desc).
>>>>
>>>> Ken Anderson
>>>> email@hidden
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>> _______________________________________________
>>> 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
>>
>> --
>> Chuck Hill             Senior Consultant / VP Development
>>
>> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
>> http://www.global-village.net/gvc/practical_webobjects
>>
>>
>>
>>
>>
>>
>>
>>
>
> _______________________________________________
> 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


 _______________________________________________
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: 
 >Order by primary key (From: Ken Anderson <email@hidden>)
 >Re: Order by primary key (From: Kieran Kelleher <email@hidden>)
 >Re: Order by primary key (From: Ken Anderson <email@hidden>)

  • Prev by Date: Re: Order by primary key
  • Next by Date: Re: Order by primary key
  • Previous by thread: Re: Order by primary key
  • Next by thread: Re: Order by primary key
  • Index(es):
    • Date
    • Thread