Greetings from cape town south Africa

Even the rookie that is  I can answer that.

1. no change to reactor file (you need aliases though - see below)
2. use the leftJoin method, and not the join( there are also left,right
methods. 

        <object name="session">
                <hasOne name="track" alias="session_track">
                        <relate from="Track_id" to="Track_id" />
                </hasOne>
                <!-- other joins omitted -->    
        </object>

Query.leftJoin("session","track","session_track");//this specifies the
relationship as there could be multiple relationships in the session object.

Make sure you have the latest version of reactor - your code seems based on
old stuff.

Theuns

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Barry Beattie
Sent: 18 July 2006 07:44 AM
To: [email protected]
Subject: [Reactor for CF] left join quick question

I've had to adjust something so Track_id is now optional. it's now a
left outer join between "session" and "track"

1) do I need to adjust anything in the reactor.xml?


        <object name="session">
                <hasOne name="track">
                        <relate from="Track_id" to="Track_id" />
                </hasOne>
                <!-- other joins omitted -->    
        </object>

        <object name="track">
                <hasMany name="session">
                        <relate from="Track_id" to="Track_id" />
                </hasMany>

        </object>


2) Is this how I can get to the left joined records?


<cfset SessionGateway = _getReactorFactory().createGateway("Session") />
<cfset Query = Session.createQuery() />

<!--- add any track details to the sessions query if available --->
<cfset Query.join("Session", "Track", "left") />

<cfset currentSessions = SessionGateway.getByQuery(Query) />



thanx


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