I have a table with a self-referencing parent column.  The depth of any
hierarchy is limited so I can write a join to fetch all the parents.

For example, if the table folder has a parent column:

select
    f.id,
    p0.id as parent0,
    p1.id as parent1,
    p2.id as parent2
from
    folder f
    left join folder p0 on p0.id = f.parent
    left join folder p1 on p1.id = p0.parent
    left join folder p2 on p2.id = p1.parent
where
    f.id = ?


I know I can specify a join multiple times

    join => [ 'parent', 'parent', 'parent' ]

and DBIC will create separate aliases but they all join to the same "base"
table.   But, I need to join like above.

Is there a way to specify these joins or do I need to use a virtual view?


-- 
Bill Moseley
[email protected]
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to