There are some great tutorials out there for the basics of ORM. If you Google for "ColdFusion ORM" you'll uncover a bunch, including lots of examples you can cut/paste from to handle the very situation you've described below. I'd also highly recommend John Whish's ORM book that you can buy in PDF edition here:
http://tinyurl.com/3t7bwab If you have tried to write the code yourself and are having a problem, please share what you tried and the problem (including any errors) that you are having. -Cameron On Mon, Dec 12, 2011 at 1:30 PM, Tom (Re-Base) <t...@re-base.net> wrote: > > Hi I am new to Coldfsuion ORM and want to linked 3 tables. Table C and A > has > a (one-to-one relationship), Table A and B has a (one-to-many > relationship), > thanks > > > > > > CREATE TABLE C ( > > searchid INTEGER(11) NOT NULL AUTO_INCREMENT, > > name VARCHAR(50) NOT NULL, > > PRIMARY KEY (searchid) > > ) > > ENGINE=InnoDB; > > > > CREATE TABLE A ( > > testid INTEGER(11) NOT NULL AUTO_INCREMENT, > > name VARCHAR(50) NOT NULL, > > PRIMARY KEY (testid) > > ) > > ENGINE=InnoDB; > > > > CREATE TABLE B ( > > findid INTEGER(11) NOT NULL AUTO_INCREMENT, > > numid INTEGER(11) NOT NULL, > > PRIMARY KEY (findid), > > FOREIGN KEY (findid) > > REFERENCES A (testid) > > ON UPDATE CASCADE > > ON DELETE CASCADE, > > FOREIGN KEY (findid) > > REFERENCES C (searchid) > > ON UPDATE CASCADE > > ON DELETE CASCADE > > ) > > ENGINE=InnoDB; > > > > I would appricayed some help > > > > Regards > > > Tom Small BSc (Hons), MBCS > > Technical Director > > Re-Base Ltd > > Database Solutions > > > > Contact Details: > > Email: <mailto:rich...@j7group.net> <mailto:t...@re-base.net> > t...@re-base.net <http://www.j7group.net/> <http://www.j7group.net/> > > Website: <http://www.re-base.net/> <http://www.re-base.net/> > www.re-base.net > > Tel: +44 (0)207 111 7768 > > > > LinkedIn: <http://uk.linkedin.com/pub/tom-small/29/81a/365> > http://uk.linkedin.com/pub/tom-small/29/81a/365 > > Twitter: <http://twitter.com/#!/Re_Base> http://twitter.com/#!/Re_Base > > > > Re-Base Ltd > > 31 Harley Street > > London > > W1G 9QS > > > > Company Number: 05613376 > > VAT Number: 924 9392 93 > > > > ---------------------------------------------------------------------------- > -------------------------------------------------- > This e-mail is confidential and privileged. If you are not the intended > recipient please accept our apologies; please do not disclose, copy or > distribute information in this e-mail or take any action in reliance on its > contents: to do so is strictly prohibited and may be unlawful. Please > inform > us that this message has gone astray before deleting it. Thank you for your > co-operation. > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349067 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm