Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Re: Re: Class::DBI multiple column primary and foreign keys

by Anonymous Monk
on May 21, 2004 at 21:18 UTC ( [id://355468]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Class::DBI multiple column primary and foreign keys
in thread Class::DBI multiple column primary and foreign keys

For what its worth, this is what sqlt comes up with
package DBI; # # Created by SQL::Translator::Producer::ClassDBI # Created on Fri May 21 14:05:57 2004 # use strict; use base 'Class::DBI::mysql'; DBI->set_db('Main', 'dbi:mysql:_', '', ''); # ------------------------------------------------------------------- package baseitems; use base 'DBI'; use Class::DBI::Pager; baseitems->set_up_table('baseitems'); # # Primary key accessor # sub baseitems { shift->id } sub itemss { return shift->items_id } baseitems->has_many( 'items_id', 'items' => 'id' ); # ------------------------------------------------------------------- package items; use base 'DBI'; use Class::DBI::Pager; items->set_up_table('items'); # # Primary key accessor # sub items { shift->id } items->has_a( id => 'baseitems' ); sub items { return shift->id } sub codess { return shift->codes_id } items->has_many( 'codes_id', 'codes' => 'id' ); items->has_many( 'codes_subid', 'codes' => 'subid' ); # ------------------------------------------------------------------- package codes; use base 'DBI'; use Class::DBI::Pager; codes->set_up_table('codes'); codes->has_a( id => 'items' ); sub codes { return shift->id } codes->has_a( subid => 'items' ); sub codes { return shift->subid } 1;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://355468]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-28 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found