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.

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to