Matthew,

Transfer does not generate methods to create compositions based on your FK
names.  Therefore, if you wish to use that convention, you must use a
decorator and and behaviour to your BO.  You have two choices.

1.

objGallery = transfer.getTransfer().new("Gallery");
objProduct = 
transfer.getTransfer().get("Product",form.Id);objGallery.setTestField("cat");
objGallery.setProduct(objProduct);
transfer.getTransfer().save(objGallery);

2.

Add a method to your Gallery Decorator

<cffunction name="setProductId" returntype="void" output="false"
access="public">
        <cfargument name="ProductId" required="yes" type="numeric" />
        <cfset var product =
getTransfer().get("Product",arguments.ProductId)>
        <cfset getTransferObject().setProduct(product) />
    </cffunction>

If you go with option 2, I'd recommend a "get" method that returns the
productId.

Why does it work this way?  Tranfer ORM is an "object relational mapper", so
one should make every effort to augment their thinking for table relations
to object relations.  It's not easy.  I had a difficult time making the
adjustment.

Best of luck!

Paul


On Thu, Feb 19, 2009 at 4:31 AM, John Whish <[email protected]>wrote:

> I find the getMemento method is really useful for debugging as you can see
> what is persisted. Just do <cfdump var="#objGallery.getMemento()#" />
> BTW: getMemento is ONLY for debugging :)
>
> >
>


-- 
Paul Marcotte
Fancy Bread - in the heart or in the head?
http://www.fancybread.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