Hi there
I am using the ORM features in CF9 and am just a bit stuck on how to replicate a left outer join query..
I have a TaskList CFC
component output="false" persistent="true"{
property name="iTaskListID" fieldtype="id" generator="native";
property name="sTitle" ormtype="string" length="50";
property name="task" fieldtype="one-to-many" cfc="Task" fkcolumn="iTaskListID"
;
}
And a Task CFC
component output="false" persistent="true"{
property name="iTaskID" fieldType="id" generator="native"; property name="sTitle" notnull="true" type="string"; property name="dtCreated" ormtype="date"; property name="iListingID" ormtype="integer"; property name="User" fieldtype="many-to-one" cfc="Users" fkcolumn="iUserID"; property name="iTaskListID" ormtype="integer"; }
I then perform an entityLoad
<cfset results = entityLoad("TaskList",url.iTaskListID,true)>
<cfset resultsQuery = entityToQuery(results)>
However, when I try and use the resultsQuery, I cannot access the task cfc properties. For example
cfoutput>
<cfloop query="resultsQuery">
#resultsQuery.iTaskID#
Will produce the error Element ITASKID is undefined in RESULTSQUERY.
Would anyone have any advice?
Many thanks