Cedric,
Heres an example from one of my apps
<object name="Client">
<hasMany name="Note">
<link name="ClientNote" />
</hasMany>
</object>
<object name="ClientNote">
<hasOne name="Client">
<relate from="ClientId" to="ClientId" />
</hasOne>
<hasOne name="Note">
<relate from="NoteId" to="NoteId" />
</hasOne>
</object>
<object name="Note">
<hasOne name="User" alias="CreatedByUser">
<relate from="CreatedByUserId" to="UserId" />
</hasOne>
</object>
In the Client object note the use of <link> instead of <relate>. This
does exactly what you described, telling reactor that ClientNote is a
link table and to create a getNotesIterator() method
Cheers, Chris
On Feb 18, 2008 7:49 PM, Cedric Villat <[EMAIL PROTECTED]> wrote:
>
>
>
>
> I have an intermediate lookup table that I need reactor to link together.
>
>
>
> For instance, I have 3 tables: Users, Groups, and UserGroups. A group has
> many users, and a user can belong to many groups. A sample table would be:
>
>
>
> Users:
>
> UserID User
>
> 1 me
>
> 2 you
>
>
>
> Groups:
>
> GroupID Group
>
> 1 groupA
>
> 2 groupB
>
>
>
> UserGroups:
>
> UserID GroupID
>
> 1 1
>
> 1 2
>
> 2 2
>
>
>
>
>
> Any idea how the reactor.xml file would set these up? I think when creating
> the Users object, I would have to have a hasMany UserGroups. Then my
> UserGroups object would have a hasMany Groups. Am I way off base here, or is
> there an easier way? Ideally I'd like to be able to do something like
> user.getGroups() when I have an instance of my user.
>
>
>
> Cedric
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- --
> Reactor for ColdFusion Mailing List
> [EMAIL PROTECTED]
> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --