Ticket #84 (new defect)
External object fields break query.returnObjectField/s
| Reported by: | cblackwell | Owned by: | dhughes |
|---|---|---|---|
| Type: | defect | Priority: | high |
| Milestone: | 1.0 Release | Component: | Reactor - Gateway |
| Version: | Severity: | critical | |
| Keywords: | spam | Cc: |
Description
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")>
Change History
Note: See
TracTickets for help on using
tickets.

