[Dbix-class] Re: what to do for join.

Hiroyuki Yamada yamahiroyu.y at gmail.com
Wed Mar 14 11:36:37 GMT 2007


I'm replying to myself.

This is what I needed.
http://lists.scsys.co.uk/pipermail/dbix-class/2007-January/003245.html
I got it.

As described above history,
it's very hard to understand joining in DBIx::Class with cd/artist
example in the document.
I'll be very appreciated that more examples for join come out anytime soon.

Thanks,

Hiroyuki Yamada

2007/3/14, Hiroyuki Yamada <yamahiroyu.y at gmail.com>:
> Hi,
>
> I'm struggling working on (inner) join in DBIx::Class.
> I looked through the documents but, didn't figure out what to do.
>
> table A (class name is 'ClassA')
> ---
> id
> tmp_id
> ---
>
> table B (class name is 'ClassB')
> ---
> id
> info1
> info2
> info3
> ---
>
> What I want to do is very simple listed below.
>
> select * from A, B where A.id = B.id and A.tmp_id = 'someid';
>
>
> In DBIx::Class
>
>     $rs = $schema->resultset('ClassB')->search(
>         {
>             'A.tmp_id' => 'someid'
>         },
>         {
>             join => [qw/A/],
>         }
>     );
>
> It doesn't work and i get the following error.
>
> "No such relationship ... "
>
> Do I have to specify the relationship for the normal join ?
> Does anybody know what to do to achieve the sql ?
>
> Thanks,
>
> Hiroyuki Yamada
>



More information about the Dbix-class mailing list