[Dbix-class] hardcoded (multicolumn) relationship (beginner)
Heiko Gruner
list at GrunerIT.de
Mon Feb 2 20:47:03 GMT 2009
Hi,
I am looking for some hints on a problem of hardcoding a relationship to
a multicolumn key in a different table:
My App Package is defined with a PK "appid".
It needs to get some entries from the Maps Package,
wheras the Maps table has a multicolumn key (fixedid and appid).
The appid columns of both tables would match 1:1.
But the "foreign.fixedid" needs to match '14'
(other Schema/Applications use other values of the fixedid in Maps).
How would i hardcode this value of "14" into this relationship ?
---------------------------------
__PACKAGE__->has_many( maps => 'Project::Schema::Maps',
{ 'foreign.fixedid' => 'self.workaroundid',
'foreign.appid' => 'self.appid'}, );
---
workaround: inserted an extra column "workaroundid" with identical data
values ('14') for the whole App table :-(
---------------------------------
replacing the 'self.fixedid' with constants (e.g. 14, '14', "14", ...)
only results in:
"undef error - Invalid rel cond val 14"
Any help appreciated!!!
regards
Heiko
More information about the DBIx-Class
mailing list