Am I limited to pre-fetching only one has_many relation? I have something
like:
package Ucam::LookupDB::Person;
use base 'Ucam::LookupDBBase';
my $keep = { cascade_delete => 0 };
__PACKAGE__->load_components("PK::Auto", "Core");
__PACKAGE__->table("people");
__PACKAGE__->add_columns("uid");
__PACKAGE__->set_primary_key("uid");
__PACKAGE__->has_many ("title",
"Ucam::LookupDB::PersonTitle",
"uid",
$keep);
__PACKAGE__->has_many ("mail",
"Ucam::LookupDB::PersonMail",
"uid",
$keep);
but attempts to do:
$db->resultset("Person")->search
({ "me.uid" => 'fjc55' },
{ prefetch => [qw/title mail/]})->single
result in:
DBIx::Class::ResultSet::single(): Prefetch not supported with accessor
'multi' at t/person.t line 118
and dito with '->first'. I expect I'm doing something stupid, or
misunderstanding something fundamental. Any pointers, or just confirmation
that I can't do what I'm trying to do, would be very welcome.
This with DBIx::Class version 0.07001.
Jon.
--
Jon Warbrick
Web/News Development, Computing Service, University of Cambridge
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/