1 Reply Latest reply on Sep 3, 2009 12:23 AM by rupesh_kumar

    Coldfusion ORM Problem

    setzergabbiani Level 1


      I'm having some trouble with coldfusion orm. Here's my scenario:

      I have 3 main components: component1, component2 and component3. The first component has relationships with the two others, and everything works fine.

      The problem is when I try to do the following in component1:

      <cfproperty name="component2id" type="numeric">

      <cfproperty name="component3id" type="numeric">

      <cfproperty name="component2" fieldtype="many-to-one" cfc"Component2" FKColumn="component2id">

      <cfproperty name="component3" fieldtype="many-to-one" cfc"Component2" FKColumn="component3id">

      If I have a property that references the same column that the FKColumn of another property, coldfusion returns a blank record (not an empty array, cfdump is completelly blank) and the server's exception.log says that a stack overflow happened. Is there something wrong with my code? I can't remove the component2id and component3id properties because I have to filter my entityload function to load an entity with those specific ids.

        • 1. Re: Coldfusion ORM Problem
          rupesh_kumar Adobe Employee

          This mapping is not allowed as there are two mapping definition for the same column "component2id" and "component3id". You can just kep the relation property and then use ORMExecuteQuery for doing the filtering. The query would look like this


          ORMExecuteQuery("From Component1 comp where comp.component2.id=? and comp.component3.id=?")