Dan,
I guess my question is: Is Cascading Saves supported when inserting records? Using my example below, if the two tables have a hasOne relation through UserID, how does or more specifically does the related table, in this case "tblUserInfo", know the value of UserID, which is the primary key and set by "tblUser" when the record is inserted to "tblUser".

I understand Cascading Updates, since the value to the related field is known.

Byron

Dan Vega wrote:
What is not working? Please be a little bit more specfic as to what is going wrong.

On 9/29/06, *Byron Raines* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Nope.  That does not seem to do it.

    byron

    Dan Vega wrote:
    > I am pretty sure that you still have to make the call. I could be
    > wrong though.
    >
    > <cfset UserRecord = Reactor.createRecord("tblUser") />
    > <cfset UserInfoRecord = UserRecord.gettblUserInfo () />
    >
    > <cfset UserRecord.setUsername("bobo") />
    > <cfset UserInfoRecord.setFirstname("bobo") />
    > <cfset UserInfoRecord.setMI("the") />
    > <cfset UserInfoRecord.setLastname ("clown") />
    >
    > <cfset USerRecord.save() />
    > <cfset UserInfo.save()/>
    >
    > On 9/29/06, *Byron Raines* < [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
    >
    >     Hi all I have the following:
    >
    >     In reactor.xml :
    >
    >             <object name="tblUser">
    >                 <hasOne name="tblUserInfo">
    >                     <relate from="UserID" to="UserID" />
    >                 </hasOne>
    >             </object>
    >
    >     I do the following to create a new record:
    >
    >     <cfset UserRecord = Reactor.createRecord("tblUser") />
    >     <cfset UserInfoRecord = UserRecord.gettblUserInfo() />
    >
    >     <cfset UserRecord.setUsername("bobo") />
    >     <cfset UserInfoRecord.setFirstname("bobo") />
    >     <cfset UserInfoRecord.setMI("the") />
    >     <cfset UserInfoRecord.setLastname ("clown") />
    >
    >     <cfset USerRecord.save() />
    >
    >     What happens is that the record is inserted into "tblUser",
    but not in
    >     "tblUserInfo".  Not sure what I'm missing here.  Does it
    have to do
    >     something with the primary key?
    >
    >     Thanks
    >
    >     byron
    >
    >
    >
    >
    >     -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    -- --
    >     -- -- -- -- --
    >     Reactor for ColdFusion Mailing List
    >     [email protected] <mailto:[email protected]>
    <mailto:[email protected] <mailto:[email protected]>>
    >     Archives at:
    http://www.mail-archive.com/reactor%40doughughes.net/
    <http://www.mail-archive.com/reactor%40doughughes.net/>
    >     -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    -- --
    >     -- -- -- -- --
    >
    >
    >
    >
    > --
    > Dan Vega
    > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
    > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    > -- -- -- --
    > Reactor for ColdFusion Mailing List
    > [email protected] <mailto:[email protected]>
    > Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
    > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    -- --
    > -- -- -- --


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




--
Dan Vega
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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