I don't think you want to do that. If you create the GUID at complie
time every TO you create will have the same default value for the GUID
field. You need to create the GUID at runtime, which is why I deferred
the CreateUUID call by moving it into the generated output. This
should give you a unique default value.


--Nathan

On 3/23/07, Ilya Fedotov <[EMAIL PROTECTED]> wrote:
following works, forgot # around MSguid


<cfcase value="guid,uniqueidentifier">
   <cfif ReFindNoCase("'*newId()'*", arguments.sqlDefaultValue)>
        <cfreturn "##insert('-', #MSguid#, 23)##" />
    <cfelse>
        <cfreturn "" />
    </cfif>
</cfcase>

On 3/23/07, Ilya Fedotov < [EMAIL PROTECTED]> wrote:
> may be like this, to minimize the change
> <cfcase value="guid,uniqueidentifier">
>                <cfif ReFindNoCase("'*newId()'*",
arguments.sqlDefaultValue)>
>                     <cfreturn "##insert('-', MSguid, 23)##" />
>                 <cfelse>
>                     <cfreturn "" />
>                 </cfif>
>             </cfcase>
>
>
> On 3/23/07, Ilya Fedotov <[EMAIL PROTECTED]> wrote:
>
> > I say submit it, I didn't dig that deep. Your solution is much better,
there is no reason why reactor shouldn't handle this, specialy there is
already code there that intends to do so.
> >
> > Did you try to add your code?
> >
> >
> >
> > On 3/21/07, Nathan Mische < [EMAIL PROTECTED]> wrote:
> > > I ran into an issue while trying to use MGU scaffolding with a table
> > > which had a uniqueidentifer primary key. I saw Ilya Fedotov's post
> > > "UUID as primary key" but this seemed like something Rector should
> > > handle without any custom code. If a uniqueidentifer field has a
> > > default value of "(newid())" then the project TO should set this
> > > value.
> > >
> > > I did some digging and found that due to a bug in the MSSQL
> > > ObjectDao.cfc the field's default value is not properly set. The
> > > problem is that the ObjectDao's getDefault method has a case statement
> > > based on the cfDataType of the field, however the case near line 128
> > > is for the dbDataType "uniqueidentifier." I think that case should be
> > > updated to something like:
> > >
> > > <cfcase value="guid">
> > >         <cfif ReFindNoCase("'*newId()'*", arguments.sqlDefaultValue)>
> > >                 <cfreturn
"##Insert(""-"",CreateUUID(),23)##" />
> > >         <cfelse>
> > >                 <cfreturn "" />
> > >         </cfif>
> > > </cfcase>
> > >
> > > I'm new to Model-Glue and Reactor so would someone care to confirm my
> > > findings before I submit a bug?
> > >
> > > Thanks,
> > >
> > > --Nathan
> > >
> > >
> > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- --
> > > 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