Aug
13
2007
Model Glue Tips Part 4: Use Generic Database Messages to speed up your development
Posted by Mark Drew at 9:06 AM
3 comments - Categories:
model-glue
- modelglue.GenericList: Which does a select * from [table]
- modelglue.GenericRead: Which does a select * from [table] where [id] = xyz
- modelglue.GenericCommit: Which will save the record (or update it depending if it already exists with that ID)
- modelglue.GenericDelete: Which will delete the record with the ID that you have passed in
<event-handler name="people.list.users">
<broadcasts>
<message name="modelglue.GenericList">
<argument name="object" value="People" />
<argument name="queryName" value="qPeopleList" />
</message>
</broadcasts>
<view>
</event-handler>
Then in my display template I can get access to the query:
<cfdump var="#viewstate.getValue("qPeopleList")#"/>
There is more functionality available such as filtering and sorting, you can check out the details in the Documentation for modelglue.GenericList
Calling the other other Generic Database functions is as simple as that, have a look at the full documentation over at http://docs.model-glue.com/ under "How To's" / "How To Use Generic Database Messages"

todd sharp wrote on 09/22/08 11:13 AM
Just to clarify, these are specific to when using an ORM with MG, correct?