There might be a really simple answer to this, but I'm afraid I can't see it
- I would really appreciate any help.
I'm trying to describe a number of relationships between two tables that
require 0 or more conditions on the join to be NULL - e.g.
MySchema->('Domain')->search(
{ domain_id => 'd1' },
{
join => [ qw/ domain_to_classification_depth_(1-4) / ],
prefetch => [ qw/ domain_to_classification_depth_(1-4) / ]
}
)
Where the relationships are defined as:
MySchema::Domain->belongs_to(
"domain_to_classification_depth_4",
"MySchema::Classification",
{
"foreign.depth_1" => "self.depth_1",
"foreign.depth_2" => "self.depth_2",
"foreign.depth_3" => "self.depth_3",
"foreign.depth_4" => "self.depth_4",
},
);
[WORKS]
MySchema::Domain->belongs_to(
"domain_to_classification_depth_2",
"MySchema::Classification",
{
"foreign.depth_1" => "self.depth_1",
"foreign.depth_2" => "self.depth_2",
"foreign.depth_3" => \"NULL",
"foreign.depth_4" => \"NULL",
},
);
[ERROR]
Invalid rel cond val NULL at
/opt/perl-5.8.8/lib/site_perl/5.8.8/DBIx/Class/Schema.pm
line 954
I've looked at the entry on DBIx::Manual::FAQ ("define a foreign key
relationship where the key field may contain NULL?". However I don't think
this quite answers my question as the table I'm joining from doesn't have
any NULL values - I just want to join to a specific row in table B where
some of those values are NULL.
Cheers,
Ian
_______________________________________________
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]