Unfortunately I'm working with an existing database from a previous WO development team. PK is the only "time-related" sortable item on existing items. I guess I could just add an "order" property that is just an incremented integer, but I was hoping to be able to use PK because that is essentially what it is in the way the DB was designed. I really need to sort from most recent to oldest and loop through them. And even then, there are only about 8,000 entries and I need the most recent 1,000. It doesn't have to be completely accurate, just a rough 1,000.
Ken Anderson [email protected] 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 protected] >>> >>> >>> >>> _______________________________________________ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list ([email protected]) >>> Help/Unsubscribe/Update your Subscription: >>> https://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com >>> >>> This email sent to [email protected] >> >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list ([email protected]) >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >> >> This email sent to [email protected] > > -- > 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 protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
