[Dbix-class] Prefetch and join on different tables

Paula mpmagarinos at gmail.com
Mon Jan 21 17:37:01 GMT 2013


Hi! Thank you for your answer. Unfortunately neither of the 2 possibilities
work. In both cases I get the same error:
[error] DBIx::Class::Row::get_column(): No such column 'h1'


2013/1/18 Patrick Meidl <pmeidl at ist.ac.at>

> On Fri, Jan 18 2013, mpm <mpmagarinos at gmail.com> wrote:
>
> > push @{ $attr->{join} }, 'mt';
> > push @{ $attr->{join} }, 'mc';
> > my $rs1 =3D $c->model('weight::Mdata')->search( $where, $attr,{prefetch=
 =3D>
> > 'mc'});
>
> I think your curly braces are misplaced. this should do what you want:
>
> my $rs1 =3D $c->model('weight::Mdata')->search($where,
>     { %$attr, prefetch =3D> 'mc' });
>
> or alternatively:
>
> push @{ $attr->{join} }, 'mt';
> push @{ $attr->{join} }, 'mc';
> $attr->{prefetch} =3D 'mc';
> my $rs1 =3D $c->model('weight::Mdata')->search($where, $attr);
>
>
> HTH
>
>     patrick
>
> --
> Patrick Meidl, Mag.
> Senior Expert Software Engineering
>
> IST - Institute of Science and Technology Austria
> Am Campus 1
> A-3400 Klosterneuburg, Austria
>
> R 03.EG.003
> T +43 2243 9000 1063
> E pmeidl at ist.ac.at
> W http://www.ist.ac.at/
>
>
> _______________________________________________
> 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/dbix-class@lists.scsys.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20130121/77a=
17f92/attachment.htm


More information about the DBIx-Class mailing list