Take the 2-minute tour ×

When using ColdFusion ORM where you have several tables with relationships can I bind a CFC to a CFGrid to get all of the columns I would like to have displayed?

Example if I have a query with 7 joins on the current application I am working on to get all of the fields I want displayed. How can I display all of the fields in CFGrid can I use bind to connect the ORM CFC to the Grid? or Do I need to do something else?

  'Request'      AS shopTypeTitle,
  Details.myshopfolderid   AS RecordId,
  Details.subject          AS ShopSubject,
  Details.solostandmodelid AS DisplayModelid,
  ShopVACM.solostandmodel  AS DisplayModel,
  GROUP_CONCAT_solostandSERIES(rfc_shopsheet.shopsheetid) AS Series,
  MAX(RequestDTGs.sortdate)                               AS RSortDate,
  MAX(RequestDTGs.sortsequence)                           AS RSeq,
  rfc_shopsheet.CreatedOn                                 AS holdshopCreateDate,
FROM rfc_shopsheet
JOIN rfc_myshopfolder Details
ON rfc_shopsheet.myshopFolderId = Details.myshopFolderId
LEFT OUTER JOIN rfc_shopsigner
ON rfc_shopsheet.shopsheetid = rfc_shopsigner.shopsheetid
LEFT OUTER JOIN rfc_requestdtg RequestDTGs
ON RequestDTGs.myshopfolderid = Details.myshopfolderid
LEFT OUTER JOIN rfc_engshop
ON rfc_shopsheet.shopsheetid = rfc_engshop.shopsheetid
LEFT OUTER JOIN rfc_requestaircraft RequestAC
ON Details.myshopfolderid = RequestAC.myshopfolderid
LEFT OUTER JOIN rfc_requestfacilitator RequestFac
ON Details.myshopfolderid = RequestFac.myshopfolderid
LEFT OUTER JOIN val_solostandseries shopVAC
ON RequestAC.solostandseriesid = shopVAC.solostandseriesid
LEFT OUTER JOIN val_solostandmodel shopVACM
ON Details.solostandmodelid = shopVACM.solostandmodelid
LEFT OUTER JOIN val_myshoplevel
ON Details.myshoplevelid = val_myshoplevel.myshoplevelid
LEFT OUTER JOIN val_division
ON Details.divisionid = val_division.divisionid
WHERE shopType        = 'F'

I would like to find a way to get ORM to join all of these columns so I can put them in ORM.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

So that I understand, you have not yet built any ORM Entities? (CFC for each table)

If you have not, all you have to do is setup all your tables (use cfbuilder with a RDS connection to build your ORM CFC files)

Once you have all your tables referenced in ORM Persisted CFC files, you can do this with a cfquery tag and dbtype = "HQL" and return the data with QueryConvertForGrid()

Then just return the data you want to your cfgrid via json or directly on the page into the cfgrid tag.

share|improve this answer
I cannot delete this and we have given up on ORM as we needed it early on in our project so I will mark this as an answer to get it off my list. I tried to delete it since I can not verify your answer since I do not have time to waste even to test this now. –  Nathan Stanford Nov 23 '11 at 13:52
add comment

<cfgrid> doesn't freaking care whether you're using ORM or not.

So just do your joins using <cfquery>, and return the result using QueryConvertForGrid() in your remote function. If you're not using bind, then just feed <cfgrid> with the actual query.

share|improve this answer
The question was using ORM not using cfquery. –  Nathan Stanford May 11 '11 at 16:32
AFAIK it's not possible –  Henry May 11 '11 at 17:08
add comment

Your Answer


