coldfusion 9 orm - how to define relationship
now pretend you have a db structure like this:

table *Object*

    {
        id,
        name
    }

table *ObjectRelation*

    {
        id,
        parentID, -- points to id in the object table
        childID   -- points to id in the object table
    }

what i'd like to have in my model is the following:

    {
        property name
        property children
        property parent
    }

how would you guys define the parent property in this case? keep in mind that the root element(s) obviously don't have a parent object.

coldfusion 9 orm - how to define relationship
===

now pretend you have a db structure like this:

table *Object*

    {
        id,
        name
    }

table *ObjectRelation*

    {
        id,
        parentID, -- points to id in the object table
        childID   -- points to id in the object table
    }

what i'd like to have in my model is the following:

    {
        property name
        property children
        property parent
    }

how would you guys define the parent property in this case? keep in mind that the root element(s) obviously don't have a parent object.
