Thanks for all your help. I am still having trouble getting the result I
need.
I will describe the problem slightly differently, perhaps it does not
fit into
the 'has_a' approach. Can I define my own query and get maypole to
display the results?
I have a table x with key columns a,b,c,d,e
I have a table y with key columns a,b,c,d,e, plus another non key column f
I would like to display all the columns in x, PLUS the column f from table y
I need to perform a join from table x to y to achieve this.
Any help appreciated.
Kim
Matt S Trout wrote:
On Thu, Dec 29, 2005 at 11:51:51AM -0600, Peter Speltz wrote:
On 12/28/05, Kim Ryan <[EMAIL PROTECTED]> wrote:
I have a database where the primary key is defined over several columns.
I have used the Class:DBI method to define by primary key
MyDB::Results->columns(Primary => qw/version resolution precision/);
MyDB::Results->columns(Other => qw/a b c/);
My problem is in constructing the one to one join with another table.
When the primary key is a single column called id, there is no problem
MyDB::Results->has_a(suite => "MyDB::Suites");
Now I want to join two tables that use the same multi column primary key
How to I define the join columns. In the example above, I just use the
column
name, suite but cannot use that for several columns.
First, the has_a relationship is not one to one. It is many to one --
Ie many Beers can have the same Brewery. You can use it like one to
one though (if you add a cascade delete) .
Your problem is a perfect might_have problem except with multi column
keys. See the docs on might_have if you have not. However they do not
support MKs :( But perhaps you could write one that did ?
All relationships under DBIx::Class support multi-col joins.
I think DBIx::Class::CDBICompat only needs meta_info added to provide the
API used by Maypole, but still haven't had time to seriously experiment with
it.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Maypole-users mailing list
Maypole-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maypole-users