Skip to main content
Participating Frequently
October 22, 2010
Question

ORM Help, please

  • October 22, 2010
  • 1 reply
  • 352 views

I am trying to get a grasp of the new ORM in CF 9.

How do I get all of the locations from the Loc table that had a GenInfoID = X?  Or did I not define the table right?

Thanks,

Darrin

Gen Info Tbl

<cfcomponent hint="I hold the general info " output="false" persistent="true">

    <cfproperty name="GenInfoID" hint="The id" type="numeric" fieldtype="id" datatype="integer" generator="identity">   

    <cfproperty name=Name" hint="name" type="string" length="255">

    <!--- Physical Desc --->

    <cfproperty name="Height" hint="height" type="string" length="50">

    <cfproperty name="Weight" hint="weight" type="string" length="50">

    <cfproperty name="EyeColor" hint="eyeColor " type="string" length="50">

    <cfproperty name="HairColor" hint="hairColor" type="string" length="50">

    <cfproperty name="DOB" hint="DOB " type="date" length="50">

  <cfproperty name="PhysicalDesc" hint="Physical Desc" type="string" length="5000">

</cfcomponent>

Loc Tbl

<cfcomponent hint="I hold the Last known infoI" output="false" persistent="true">

    <cfproperty name="LastKnownID" hint="The id for the POI Last Known" type="numeric" fieldtype="id" datatype="integer" generator="identity">   

    <cfproperty name="Latitude" hint="latitude" type="numeric">

    <cfproperty name="Longitude" hint="longitude" type="numeric">

    <cfproperty name="Summary" hint="Summary" type="string" length="5000">

    <cfproperty name="DateEntered" hint="dateEntered" type="date" length="50">

    <cfproperty name="GenInfoID" singularname="GenInfoID" fieldtype="many-to-one" cfc="GenInfo" fkcolumn="GenInfoID"/>

</cfcomponent>

    This topic has been closed for replies.

    1 reply

    sabot1Author
    Participating Frequently
    October 22, 2010

    i got that I had to add

    <cfproperty name="LastKnown" singularname="LastKnown" fieldtype="one-to-many" cfc="LastKnown" fkcolumn="GenInfoID"/>

    but still can not get how to pull the values from the Loc Tbl?

    Inspiring
    October 22, 2010

    Try this,

    <cfproperty name="LastKnown"  singularname="LastKnown"  fieldtype="id,one-to-many" cfc="LastKnown"  fkcolumn="GenInfoID"/>

    HTH