I haven't had time to review the parent email, but I can say that sean's
wrong here.

The linking object needs to have a hasOne relationship to the two objects
that are being linked.  The two objects being linked need hasMany
relationships to the linked object with the link tag specifying the linking
object.  IE:

<object name="User>
        <hasMany name="Address">
                <link name="UserAddress" />
        </hasMany>
</object>

<object name="UserAddress">
        <hasOne name="User">
                <relate from="userId" to=" userId " />
        </hasOne>
        <hasOne name="Address">
                <relate from="addressId" to="addressId" />
        </hasOne>
</object>

<object name=" Address ">
        <hasMany name="User">
                <link name="UserAddress" />
        </hasMany>
</object>


Doug


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Sean Corfield
Sent: Saturday, June 24, 2006 8:56 PM
To: [email protected]
Subject: Re: [Reactor for CF] Basic Object Relationship Issue

On 6/24/06, Jeff Chastain <[EMAIL PROTECTED]> wrote:
> I have a simple db with 5 tables ... contact, address, state, country, and
> contactAddress.  The contact can have one or more addresses and vice versa
> (hence the linking table contactAddress).  The address then has a state
and
> a country.  So what have I missed here ...

I think the <link> tag needs a <relate> child to specify which columns
key in/out of the link table.

>    <hasMany name="address">
>     <link name="contactAddress" />
... need <relate> tag here? ...
>    </hasMany>
-- 
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
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