I bet this is a bug in how the external field tag works. Mind logging this as a bug?
Doug -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Blackwell Sent: Monday, September 25, 2006 2:02 PM To: [email protected] Subject: [Reactor for CF] OO Query problem with external fields I've been trying to get an OO query to return a two columns, with only distinct values, but for some reason it was ignoring the returnObjectField, and returning every column. Heres my code. <object name="ProductOption"> <field source="Option" field="Name" /> <hasOne name="Option"> <relate from="OptionId" to="OptionId" /> </hasOne> </object> <cfset pog = rf.createGateway("ProductOption")> <cfset q = pog.createQuery()> <cfset q.getWhere().isEqual("ProductOption", "ProductId", 1)> <cfset q.getOrder().setAsc("ProductOption", "OptionId")> <cfset q.returnObjectField("ProductOption", "OptionId")> <cfset q.setDistinct(true)> <cfdump var="#pog.getByQuery(q)#"> After much head scratching I removed the external field from the ProductOption object and blew away my project files and it now works. Also, joining the tables "manually" does work and I get only my desired columns <cfset q.join("ProductOption", "Option", "Option")> <cfset q.returnObjectField("Option", "Name")> Is this a bug caused by the addition of the external fields feature? Chris -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 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/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
