[Dbix-class] Problems getting prefetch to work..
davekam at pobox.com
Sun Jun 25 10:25:45 CEST 2006
You have to search for "me.sessionid" instead of "sessionid" when you
do the search. If there are multiple tables involves, each has to be
prefixes with its alias -- that's just how SQL works. Some databases
let you get away with not doing it in some circumstances, but
obviously this is not one of them. :-)
On Jun 24, 2006, at 9:45 PM, Tim Watson wrote:
> __PACKAGE__->belongs_to(username => 'Db::Schema::User');
> so try "username" since that's the name of the relationship.
> Thats what I had in my original question.. It gives a mysql error...
> SELECT me.sessionid, me.username, username.username, username.password
> FROM session me JOIN user username ON ( username.username =
> me.username ) WHERE ( sessionid = ? )' (`123456')
> The sessionid in the where clause is not attributed to any table...
> Thanks for all the replies though.. This is a very cool module.
More information about the Dbix-class