Wheels Blog
Archives By Subject
Recent Comments
- Wheels 0.9: The Final Final Beta Cycle
air max said: http://www.saleairmax.com... nike air max http://www.saleairmax.com... air max http://www.saleairmax.com...... - Learning Wheels Litepost Contest winners are
Russ Johnson said: Great Job! and congrats to the winners! - Learning Wheels Litepost Contest winners are
Mike Henke said: I was really impressed with the entries :-) Quality work and the code is on github for people to lo... - Learning Wheels Litepost Contest winners are
Raul Riera said: Congratulations to the winners :D I like the use of jQuery over the Scaffold output - Learning Wheels Litepost Contest winners are
tony petruzzi said: congrats to all the contestants and winners.
Associations Chapter in Documentation
May 7, 2009 by Chris Peters
A big part of Wheels's included ORM is its use of associations to describe relationships between models. It's been a long time coming, but we released a chapter in the Docs about associations along with the 0.9.1 release of ColdFusion on Wheels.
Associations allow you to join data together in dynamic ways without needing to write any SQL.
For example, once you define in your models that a user "has many" group memberships, you can make calls like this to obtain a query object containing the user's group memberships:
<cfset user = model("user").findByKey(params.key)>
<cfset memberships = user.groupMemberships()>
<cfset memberships = user.groupMemberships()>
This is a very small taste of what associations can do for you. Be sure to read the chapter to learn all about setting up associations and what's possible.


Comments
There are no comments for this entry.
[Add Comment]