[Dbix-class] can't locate object method "union" when using DBIx::Class::Helper::ResultSet::SetOperations

Leandro Hermida softdev at leandrohermida.com
Wed Jul 27 13:29:27 GMT 2011


Hi,

Trying to do unions with DBIx::Class, installed DBIx::Class::Helpers and
then followed docs.  Loaded component in the result class files:

package MyApp::Schema::Result::GeneSetAnnotation;
use base 'DBIx::Class::Core';
__PACKAGE__->load_components(qw/Helper::ResultSet::SetOperations/);

and...

package MyApp::Schema::Result::ContrastDataSetAnnotation;
use base 'DBIx::Class::Core';
__PACKAGE__->load_components(qw/Helper::ResultSet::SetOperations/);

Then in my code I wrote the following:

my @annotations =3D
$schema->resultset('ContrastDataSetAnnotation')->search(undef, {
    columns =3D> [qw( name value )],
})->union($schema->resultset('GeneSetAnnotation')->search(undef, {
    columns =3D> [qw( name value )],
}))->all();

I get there error:

Can't locate object method "union" via package "DBIx::Class::ResultSet" at
./test_union.pl line 15.  What am I doing wrong?

regards,
Leandro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110727/5c2=
54cbd/attachment.htm


More information about the DBIx-Class mailing list