Hi,

I have got the error message "DBIx::Class::ResultSet::next(): No such 
relationship.." when I try to do a join with more than two tables.

That is, whenever I perform queries in my model with join in which there are 
less than three tables, everything is OK.

For example, next query works ok:

my $test3 = $c->model('DB::A')->search({
                        -and => [ 'users.id' => $c->user->get('id')
                                  ]},
                                  { join => {b_a' => 'b'}
                                  });

But next one fails:

my $test4 = $c->model('DB::A')->search({
                                    -and => [ 'users.id' =>  $c->user->get('id')
                                              ]},
                                              { join => {b_a' => 'b' => 'b_c'}
                                              });


Relations are defined correctly, as I have tested all relations by doing joins 
with less than three tables. The problem arises when I use three tables.
If I execute queries using joins with three, four, or more tables in MySQL 
commandline, they work perfectly. In fact, the database works as I was using it 
with DBI module.


My database tables relations are:

A => has many =>  A_B / A_B => belongs to => A
B => has many =>  A_B / A_B => belongs to => B
B => has_many => B_C / B_C => belongs to => B
C => has many => B_C / B_C => belongs to => C

 
Thanks in advanced,

David


      
_______________________________________________
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