No question is a stupid question. The only reason I know this and can help you is because someone helped me.
Michael PS: The docs do help sometimes, though... :) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Billings Sent: Friday, February 10, 2006 9:53 AM To: [email protected] Subject: RE: Reactor For CF output relational recordset This does make sense. I will read the documentation closer before I post another stupid question. Thanks. ---------- Original Message ---------------------------------- From: "Michael Lantz" <[EMAIL PROTECTED]> Reply-To: [email protected] Date: Thu, 9 Feb 2006 22:40:53 -0700 >Brian, > >I am little bit confused by your code below, so I will use my own example. > >If you are using a gateway object, you would just want to do a join to >get the results you want. > ><cfset ActivityGateway = variables.reactor.createGateway("Activity") /> ><cfset query = ActivityGateway.createQuery() /> <cfset >query.join("Activity","Sponsor") /> <cfset ActivityList = >ActivityGateway.getByQuery(query) /> > >Now, you will have access to the fields in both tables (Activity and >Sponsor) in the "ActivityList" object. > >Hope that makes sense. > >Michael > > >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of >Brian Billings >Sent: Thursday, February 09, 2006 9:48 PM >To: [email protected] >Subject: Reactor For CF output relational recordset > > >All, I have two tables. ACTIVITIES and SPONSORS. Each sponsor has many >activities. > > >When I use the gateway I get this output. How do I get the text value >of the sponsor to show in the activities list? > > >Output: >Name Sponsor Duration Code >Test1 6 60 code1 >Teat2 3 30 code2 > > > >Controller function: > > > <cffunction name="ListActivities" access="public" output="false" >returntype="ModelGlue.Core.Event"> > <cfargument name="event" type="ModelGlue.Core.Event" >required="true"> > <cfset var local = structnew() /> > <cfset local.gateway = variables.reactor /> > <cfset local.gateway.creategateway('Activity') >/> > > <cfset >arguments.event.setValue("Activities",local.gateway.getall()) /> > <cfreturn arguments.event /> > </cffunction> > > > >Reactor config: ><reactor> > <config> > <dsn value="CCARC" /> > <type value="mssql" /> > <mapping value="/Reactor" /> > <mode value="development" /> > </config> > <objects> > <object name="activity"> > <hasone name="sponsor"> > <relate from="sponsor_id" to="sponsor_id" /> > </hasone> > </object> > </objects> ></reactor> > > >Tables: >CREATE TABLE [dbo].[ACTIVITY] ( > [ACTIVITY_ID] [int] IDENTITY (1, 1) NOT NULL , > [SPONSOR_ID] [int] NOT NULL , > [ACTIVITY_CODE] [varchar] (50) COLLATE >SQL_Latin1_General_CP1_CI_AS NULL , > [ACTIVITY_NAME] [varchar] (100) COLLATE >SQL_Latin1_General_CP1_CI_AS NOT NULL , > [ACTIVITY_DESC] [varchar] (2000) COLLATE >SQL_Latin1_General_CP1_CI_AS NOT NULL , > [DURATION] [int] NOT NULL , > [ORIG_UPDATE] [smalldatetime] NOT NULL , > [LAST_UPDATE] [smalldatetime] NOT NULL , > [IS_ACTIVE] [bit] NOT NULL >) ON [PRIMARY] >GO > >CREATE TABLE [dbo].[SPONSOR] ( > [SPONSOR_ID] [int] IDENTITY (1, 1) NOT NULL , > [CONTACT_NAME] [varchar] (100) COLLATE >SQL_Latin1_General_CP1_CI_AS NOT NULL , > [CONTACT_PHONE] [varchar] (50) COLLATE >SQL_Latin1_General_CP1_CI_AS NULL , > [SPONSOR_NAME] [varchar] (100) COLLATE >SQL_Latin1_General_CP1_CI_AS NOT NULL , > [ORIG_UPDATE] [smalldatetime] NOT NULL , > [LAST_UPDATE] [smalldatetime] NOT NULL , > [IS_ACTIVE] [bit] NOT NULL >) ON [PRIMARY] >GO > > > > > > > > ________________________________________________________________ Sent via the WebMail system at brianbillings.com

