I have the following tables: Email, Person, Email_Types (e.g. Home, Office,
etc). Person and Email are linked using the standard link table. There is a
"TypeID" in the Email table which refers to the Email_Types table. Its
possible for me to do this:

<cfset EmailAddressQuery = PersonRecord.getEmailIterator.getQuery()>

And this represents a query of all the email addresses for the given Person
that I have previously load()ed. Now if I dump out the that query it only
contains the fields that are in the actual Email table, as expected. How
would I set it up so that the email query would join itself on the "TypeID"
field and bring in that info? Would I have to loop over my query and do a
Reactor.createRecord("Email") and muck with the Query object to do a join on
"Email_Types" is there some way I can have all of this done for me
(preferably w/o incurring the overheard of looping over the query and
creating each EmailRecord when having just a query for display purposes
would suffice)?

I have something like this in my reactor.xml

<object name="Email">
        <hasOne name="Email_Types" alias="EmailType">
                <relate from="TypeID" to="ID" />
        </hasOne>               
</object>

But when I am talking to my EmailIterator via my PersonRecord it doesnt
really know about it:

<object name="Person">
        <hasMany name="Email">
                <link name="PersonEmailLink" />
        </hasMany>
</object>

So I am not sure how to bring it all together. How about if in the future I
wanted to take a step back and operate on Emails w/o going thru
PersonRecord?

Thanks
/Cody


 

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


Reply via email to