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

More CF9 ORM help, please

New Here ,
Oct 25, 2010 Oct 25, 2010

Good Day,

  I have these two table, a user table which hold a user info, and then a friends table which will hold 2 user IDS.  But I do not think I have it set up right, as I can not get to the data in the friends table. 

Please advise on how to do this.

Many thanks.

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

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

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

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

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

</cfcomponent>

<cfcomponent persistent="true">

     <cfproperty name="KnownAssociatesID" hint="The id for the Known Associates" type="numeric" fieldtype="id" datatype="integer" generator="identity">

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

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

</cfcomponent>

623
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 25, 2010 Oct 25, 2010

Hi,

Can't get your actual requirement. Can you please provide more inputs?.

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 25, 2010 Oct 25, 2010

Hey thanks,

  So you have a user who has a friend, so in the friend tbl I want to put a ID field, the user, and the user friend ID.  Now the friend is just another record in the user tbl.

So I am not sure I built the table right, and then how to CRUD that data.

Thanks for the help,

Darrin

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 25, 2010 Oct 25, 2010

Hi Darrin,

I presume, you are trying to select users who are presented in user as well as friends tables before doing your CRUD.

Correct me if I am wrong.

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 25, 2010 Oct 25, 2010
LATEST

So in the friends table, I have my ID and your ID.

and when I pull my page up, I should be able to get your name

But I do not think I built the tables right, I am new to CF ORM and havinf some issues with stuff like this

In the end I would like to be able to pull a user up and see every friend, no matter which col in the friends tbl

if that makes sense

Thanks again,

Darrin

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