How to order by property of a linked-linked table?

15 views
Skip to first unread message

Marc

unread,
Oct 1, 2011, 8:23:52 AM10/1/11
to transf...@googlegroups.com
Hi,

I have 3 tables, menu, menutitle and language. All are related. When getting a menu I want to get the menutitle collection as a struct ordered by a property that is defined in object language

Transfer.xml:

        <object name="menu">
            <id name="id" type="numeric" />
            <onetomany name="menuTitle">
                <link to="menuTitle" column="FK_menu"/>
                <collection type="struct">
                    <key property="ISOLanguageCode"/>
                </collection>
            </onetomany >
        </object>

       
        <object name="menuTitle">
            <id name="id" type="numeric" />
            <property name="menuTitle" type="string" nullable="false" />
            <manytoone name="language">
                <link to="language" column="FK_language"/>
            </manytoone>
        </object>

        <object name="language">
            <id name="id" type="numeric" />
            <property name="ISOlanguageCode" type="string" nullable="false" />
            <property name="title" type="string" nullable="false" />
        </object>

object menu has <onetomany name="menuTitle"> to menutitle (1 menu object can have multiple titles in different languages), menutitle has a <manytoone name="language"> to language (many lmenutitles point to the same language). When I tell Transfer to get a menuObject I want all menutitles in a struct ordered by property
language.ISOlanguageCode.

My current Transfer.xml

<onetomany name="menuTitle">
                <link to="menuTitle" column="FK_menu"/>
                <collection type="struct">
                    <key property="ISOLanguageCode"/>
                </collection>
            </onetomany >

results in an error:

"The method getISOLanguageCode was not found in component C:\www\CMS\Framework\CMS\Transfer\com\TransferObject.cfc.
Ensure that the method is defined, and that it is spelled correctly. "

Is what I want possible in Transfer?

Marc
Reply all
Reply to author
Forward
0 new messages