Re: Date-Only NSTimestamps
Re: Date-Only NSTimestamps
- Subject: Re: Date-Only NSTimestamps
- From: Q <email@hidden>
- Date: Thu, 3 Jan 2008 10:32:05 +1000
On 03/01/2008, at 9:58 AM, Pierce T. Wetter III wrote:
On Jan 2, 2008, at 2:47 PM, Mike Schrag wrote:
It might be possible now using the new enum support in 5.4, but
only as a hack, and I haven't looked at it.
It should, actually ... The bug I filed that I /think/ turned into
this feature was to be able to do "CryptoString" that properly maps
in and out of the DB, which is basically the same issue you're
referring to but just with dates.
Yeah, then you could store dates in the database as INTEGERs, and
have a class to map to/from timestamps as needed. So its not just
enums in 5.4, you can map attributes in general? The release note
says "support for enum in attribute conversion", but I had no idea
of the details.
I may be missing something here, can't you already do this using a
custom data type class?? I had to do exactly this recently to handle a
table that stores a datetime field as a unix time epoch value and it
was a simple case of subclassing NSTimestamp and writing factory and
conversion methods to handle the conversion.
Yes, it would be nicer to have used a factory class to do the
conversion to arbitrary types, but this way seems to work fine for
dates, and other types that can be subclassed.
--
Seeya...Q
Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806
_______________________________________________
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