You can set the GUID manually before you save the object, and Transfer will
use that on inserting.

If you want to use Transfer's createGUID function ('cause it's pretty
fast!), have a look here:
http://docs.transfer-orm.com/html/transferapi/transfer/com/util/Utility.html#createGUID()

Just create an instance of the Util class, and use it, it has no
dependencies.

Mark

On Fri, Mar 27, 2009 at 10:07 PM, John Whish <[email protected]>wrote:

>
> Hi, I'm using Transfer to manage my keys. For example.
>
> <id name="HistoryID" column="history_id" type="GUID" generate="true" /
> >
>
> Is there a way to get Transfer to generate the GUID, before the object
> is saved?
>
> At the moment I'm having to save the History object twice (the first
> time is an insert, then an update). Something like this:
>
> <cfset History = getTransfer().get( "History" ) />
>
> <cfset invalidCounter = 0 />
> <!--- set a value we will overwrite as it is a required property --->
> <cfset History.setInvalid( invalidCounter ) />
> <!--- save the history object to populate the id --->
> <cfset getTransfer().save( History ) />
>
> <cfloop from="1" to="#ArrayLen( arrayOfStructsFromFlex )#"
> index="index">
>  <cfset Result = getTransfer().new( "Result" ) />
>  <cfif !arrayOfStructsFromFlex[ index ].IsValid>
>    <cfset invalidCounter ++ />
>  </cfif>
>  <cfset Result.setHistory( History ) />
>  <cfset getTransfer().save( Result ) />
> </cfloop>
>
> <cfset History.setInvalid( invalidCounter ) />
> <cfset getTransfer().save( History ) />
> >
>


-- 
E: [email protected]
W: www.compoundtheory.com

--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to