So you were totally headed in the right direction the first time.

The FK value for a M2O is determined by what object is in that relationship.

If there is no Object in that relationship, it attempts to insert NULL.
See: http://docs.transfer-orm.com/wiki/Handling_Null_Values.cfm#Foreign_Keys

This means that somewhere along the lines, that relationship is not actually
being set in your code.

Mark


On Thu, Oct 22, 2009 at 5:25 AM, marc <[email protected]> wrote:

> I retrieve a new text object like this:
>
>        <cfset local.oText=transfer.new("CMS.text")>
>
> I update the transfer object's value for the FK_objectTypeId with
>
> <!--- get the transfer object 'objectType' that corresponds to the
> object with the given id value --->
> <cfset local.oObjectType=transfer.get
> ("CMS.objectType",formdata.objectTypeId)>
> <--- update the CMSobject's foreign key value --->
> <cfset local.oText.setObjectType(local.oObjectType)>
>
> (CMS.objectType is defined also in the transfer.xml file, I don't show
> it for brevity)
>
> When I want to save the text object with
>
> <cfset transfer.save(local.oText)>
>
> I get a message
>
> Column 'FK_objectType' cannot be null
>
> So I think "OK, that makes sense since I did not specify the property
> FK_objectType' in the object and then Transfer wants to insert a null
> value in this column which I forbade in MySQL"
>



-- 
E: [email protected]
T: http://www.twitter.com/neurotic
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