I think this only becomes a problem when you want to create a new record
with reactor.  If you only read/update existing data with reactor then
it will do that without problem as long as the SKU column is the PK for
the table.

If there is a mechanism for getting a "new" SKU available then you may
be able to edit the objects custom cfc to implement this.

If for example you only wanted to assign a new SKU when you actually
saved a new record you could edit the custom objectRecord.cfc and
override the save() method

<cffunction name="save" access="public" output="false"
returntype="void">
        <cfargument name="useTransaction" required="no" type="boolean"
default="true" />

        <!--- Assuming SKUs are numeric --->
        <cfif this.getMySKU() EQ 0>
                <!--- Implement logic to get a new SKU here 
                You can use _getReactorFactory() here to access reactor
--->
                <cfset this.setMySKU(newsku)>
        </cfif>

        <cfset super.save(arguments.useTransaction)>

</cffunction>

HTH
Cheer, Chris


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
> Behalf Of Brad Haas
> Sent: 08 August 2006 20:22
> To: [email protected]
> Subject: Re: [Reactor for CF] Using GUID/UUID for Primary Key
> 
> I may be reading this thread wrong, but are you guys saying that you
> cannot create your own primary key to use in MS SQL Server?  I've got
> a few tables in a db that use a SKU as a primary key and it is not
> auto assigned by SQL nor is it a guid.
> 
> Is this going to be a problem for me or am I just reading this out of
> context?
> 
> Thanks,
> Brad
> 
> On Aug 8, 2006, at 9:59 AM, Wayne Graham wrote:
> 
> > It's documented (though it took me a while to find it) at http://
> > livedocs.reactorframework.com/Save_Changes_to_a_Record.htm
> >
> > Basically, throw this code into the TO:
> >
> > <cfset this.primaryKey = createUUID() />
> >
> > HTH,
> > Wayne
> >
> > Mark Drew wrote:
> >> I am also trying to do this, but on mysql (there is a reason I
> >> need CF
> >> uuid's .. honest!)
> >> Can I change the TO to handle this?
> >> Sorry for the "n00b" question... considering I have been singing
and
> >> lecturing Reactor's prases!)
> >> MD
> >> On 8/8/06, Marc Funaro <[EMAIL PROTECTED]> wrote:
> >>>
> >>>    >   -----Original Message-----
> >>>    >   From: [EMAIL PROTECTED]
> >>>    >   [mailto:[EMAIL PROTECTED] On Behalf Of Doug
Hughes
> >>>    >   Sent: Tuesday, August 08, 2006 8:42 AM
> >>>    >   To: [email protected]
> >>>    >   Subject: RE: [Reactor for CF] Using GUID/UUID for Primary
Key
> >>>    >
> >>>    >   Marc - Just use MSSQL's guid column type.  Reactor
> >>>    >   automatically translates between CF and MSSQSL's
> >>>    >   guid/uuid formats.
> >>>    >
> >>>    >   Doug
> >>>
> >>> Truly Truly Awesome.  I can't tell you how cool this all is.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>> -- -- -- -- --
> >>> Reactor for ColdFusion Mailing List
> >>> [email protected]
> >>> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
> >>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>> -- -- -- -- --
> >>>
> >>>
> >
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > -- -- -- -- --
> > Reactor for ColdFusion Mailing List
> > [email protected]
> > Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > -- -- -- -- --
> >
> 
> 
> 
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
> -- --
> Reactor for ColdFusion Mailing List
> [email protected]
> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
> -- --
> 
> 
> 




-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to