Hi thanks for post i made it like you advised but it didn't help here is the code:
Finally i've done it through DBIx it is better documented with more users. Thanks###################################################################### +########## # Package MyDictionary::DBI # # Represents object oriented form of my Database package MyDictionary::DBI; use base "Class::DBI::SQLite"; MyDictionary::DBI->set_db('Main', "dbi:SQLite:dbname=Dictionary.db"); ###################################################################### +########## # Package MyDictionary::En_To_Sk # # Represents en_to_sk table package MyDictionary::En_To_Sk; use base "MyDictionary::DBI"; MyDictionary::En_To_Sk->set_up_table('en_to_sk'); MyDictionary::En_To_Sk->columns(All => (eng_id sk_id)); MyDictionary::En_To_Sk->has_a('eng_id' => "MyDictionary::Engword"); MyDictionary::En_To_Sk->has_a('sk_id' => "MyDictionary::Skword"); # Package MyDictionary::Engword # # Represent englishword table package MyDictionary::Engword; use base "MyDictionary::DBI"; MyDictionary::Engword->set_up_table("englishword"); MyDictionary::Engword->columns(Primary => qw/eng_id/); MyDictionary::Engword->columns(All => (eng_id engword)); MyDictionary::Engword->has_many("translations", 'MyDictionary::En_To_S +k', 'eng_id'); #MyDictionary::Engword->has_many('translations',['MyDictionary::En_To_ +Sk' => 'skword'], 'engword'); ###################################################################### +########## # Package MyDictionary::Skword # # Represent skwordmeaning table package MyDictionary::Skword; use base "MyDictionary::DBI"; MyDictionary::Skword->set_up_table("skwordmeaning"); MyDictionary::Skword->columns(Primary => qw/sk_id/); MyDictionary::Skword->columns(All => (sk_id skword)); #MyDictionary::Skword->has_many('translations',['MyDictionary::En_To_S +k' => 'engword'], 'skword'); MyDictionary::Skword->has_many("translations", 'MyDictionary::En_To_Sk +', 'sk_id');
In reply to Re^2: Class DBI many to many
by zooey
in thread Class DBI many to many
by zooey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |