Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ORM Help, please

New Here ,
Oct 22, 2010 Oct 22, 2010

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>

315
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 22, 2010 Oct 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 22, 2010 Oct 22, 2010
LATEST

Try this,

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

HTH

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources