Skip to main content
Participating Frequently
October 25, 2010
Question

More CF9 ORM help, please

  • October 25, 2010
  • 4 replies
  • 633 views

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>

    This topic is closed to new replies. Start a new post to keep the conversation going.

    4 replies

    Inspiring
    October 25, 2010

    Hi,

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

    sabot1Author
    Participating Frequently
    October 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

    Inspiring
    October 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.